Commit 0b1c4f93 authored by Konstantin Munichev's avatar Konstantin Munichev Committed by Lluis Gifre Renom
Browse files

Use randomized user name to connect blockchain

parent a3bd8d30
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -41,13 +41,15 @@ import fabric.FabricConnector
import io.grpc.Server
import io.grpc.Server
import io.grpc.ServerBuilder
import io.grpc.ServerBuilder
import proto.Config
import proto.Config
import kotlin.random.Random
import kotlin.random.nextUInt


class FabricServer(val port: Int) {
class FabricServer(val port: Int) {
    private val server: Server
    private val server: Server


    init {
    init {
        val cfg = Config.DltConfig.newBuilder().setWallet("wallet").setConnectionFile("config/connection-org1.json")
        val cfg = Config.DltConfig.newBuilder().setWallet("wallet").setConnectionFile("config/connection-org1.json")
            .setUser("appUser")
            .setUser("appUser" + Random.nextUInt())
            .setChannel("dlt")
            .setChannel("dlt")
            .setContract("basic").setCaCertFile("config/ca.org1.example.com-cert.pem").setCaUrl("https://teraflow.nlehd.de:7054")
            .setContract("basic").setCaCertFile("config/ca.org1.example.com-cert.pem").setCaUrl("https://teraflow.nlehd.de:7054")
            .setCaAdmin("admin").setCaAdminSecret("adminpw").setMsp("Org1MSP").setAffiliation("org1.department1")
            .setCaAdmin("admin").setCaAdminSecret("adminpw").setMsp("Org1MSP").setAffiliation("org1.department1")