diff --git a/src/main/kotlin/jp/co/soramitsu/load/UserFlow.kt b/src/main/kotlin/jp/co/soramitsu/load/UserFlow.kt index 767c796..892ce0b 100644 --- a/src/main/kotlin/jp/co/soramitsu/load/UserFlow.kt +++ b/src/main/kotlin/jp/co/soramitsu/load/UserFlow.kt @@ -39,7 +39,7 @@ class UserFlow : Wrench13() { val userFlowScn = scenario("userFlowScn") .feed(csv("preconditionList.csv").circular()) .exec { Session -> - //iroha2Client = buildClient(SimulationConfig.simulation.configuration()) + iroha2Client = buildClient(SimulationConfig.simulation.configuration()) anotherDevKeyPairSender = adminKeyPair domainIdSender = Session.get("domainIdSender")!!.asDomainId() anotherDevAccountIdSender = Session.get("anotherDevAccountIdSender")!!.asAccountId() @@ -47,7 +47,6 @@ class UserFlow : Wrench13() { anotherDevAssetIdSender = Session.get("anotherDevAssetIdSender")!!.asAssetId() Session }.exec { Session -> - val iroha2Client = builder("peer-0/api") runBlocking { QueryBuilder.findAssetsByAccountId(anotherDevAccountIdSender) .account(anotherDevAccountIdSender) @@ -55,10 +54,10 @@ class UserFlow : Wrench13() { .let { query -> iroha2Client.sendQuery(query) } + println("findAssetsByAccountId") } Session }.exec { Session -> - val iroha2Client = builder("peer-1/api") runBlocking { QueryBuilder.findAccountsByDomainId(domainIdSender) .account(anotherDevAccountIdSender) @@ -66,10 +65,10 @@ class UserFlow : Wrench13() { .let { query -> iroha2Client.sendQuery(query) } + println("findAccountsByDomainId") } Session }.exec { Session -> - val iroha2Client = builder("peer-2/api") runBlocking { QueryBuilder.findAllAssets() .account(anotherDevAccountIdSender) @@ -77,10 +76,10 @@ class UserFlow : Wrench13() { .let { query -> iroha2Client.sendQuery(query) } + println("findAllAssets") } Session }.exec { Session -> - val iroha2Client = builder("peer-3/api") runBlocking { QueryBuilder.findAllAssets() .account(anotherDevAccountIdSender) @@ -88,10 +87,10 @@ class UserFlow : Wrench13() { .let { query -> iroha2Client.sendQuery(query) } + println("findAllAssets") } Session }.exec { Session -> - val iroha2Client = builder("peer-4/api") runBlocking { QueryBuilder.findAllTransactions() .account(anotherDevAccountIdSender) @@ -99,10 +98,10 @@ class UserFlow : Wrench13() { .let { query -> iroha2Client.sendQuery(query) } + println("findAllTransactions") } Session }.exec { Session -> - val iroha2Client = builder("peer-0/api") runBlocking { QueryBuilder.findTransactionByHash(hash) .account(anotherDevAccountIdSender) @@ -110,10 +109,10 @@ class UserFlow : Wrench13() { .let { query -> iroha2Client.sendQuery(query) } + println("findTransactionByHash") } Session }.exec { Session -> - val iroha2Client = builder("peer-1/api") runBlocking { QueryBuilder.findAccountsByDomainId(domainIdSender) .account(anotherDevAccountIdSender) @@ -121,10 +120,10 @@ class UserFlow : Wrench13() { .let { query -> iroha2Client.sendQuery(query) } + println("findAccountsByDomainId") } Session }.exec { Session -> - val iroha2Client = builder("peer-2/api") runBlocking { QueryBuilder.findAllAssets() .account(anotherDevAccountIdSender) @@ -132,21 +131,23 @@ class UserFlow : Wrench13() { .let { query -> iroha2Client.sendQuery(query) } + println("findAllAssets") } Session }.exec { Session -> - val iroha2Client = builder("peer-3/api") runBlocking { QueryBuilder.findAllAssets() .account(anotherDevAccountIdSender) .buildSigned(anotherDevKeyPairSender) .let { query -> iroha2Client.sendQuery(query) + }.also { + } + println("findAllAssets") } Session }.exec { Session -> - val iroha2Client = builder("peer-4/api") runBlocking { QueryBuilder.findAllTransactions() .account(anotherDevAccountIdSender) @@ -154,6 +155,7 @@ class UserFlow : Wrench13() { .let { query -> iroha2Client.sendQuery(query) } + println("findAllTransactions") } Session } diff --git a/src/main/kotlin/jp/co/soramitsu/load/toolbox/Wrench13.kt b/src/main/kotlin/jp/co/soramitsu/load/toolbox/Wrench13.kt index 3a0b3c8..dfcddb6 100644 --- a/src/main/kotlin/jp/co/soramitsu/load/toolbox/Wrench13.kt +++ b/src/main/kotlin/jp/co/soramitsu/load/toolbox/Wrench13.kt @@ -23,7 +23,8 @@ import java.security.KeyPair open class Wrench13 { val urls: MutableList = mutableListOf() - val peers = arrayOf("peer-0/api", "peer-1/api", "peer-2/api", "peer-3/api", "peer-4/api") + //val peers = arrayOf("peer-0/api", "peer-1/api", "peer-2/api", "peer-3/api", "peer-4/api") + val peers = arrayOf("peer-0/api", "peer-1/api", "peer-2/api") val bobAccountId = AccountId("wonderland".asDomainId(), "bob".asName()) val aliceAccountId = AccountId("wonderland".asDomainId(), "alice".asName()) val admin = AccountId("wonderland".asDomainId(), "bob".asName()) @@ -72,7 +73,7 @@ open class Wrench13 { return builder(randomPeer) } - fun builder(randomPeer: String): AdminIroha2Client { + private fun builder(randomPeer: String): AdminIroha2Client { val peerUrl = URIBuilder().let { it.scheme = SimulationConfig.simulation.targetProtocol() it.host = SimulationConfig.simulation.targetURL() @@ -88,8 +89,6 @@ open class Wrench13 { urls[0], log = false, credentials = SimulationConfig.simulation.remoteLogin() + ":" + SimulationConfig.simulation.remotePass(), - /*eventReadTimeoutInMills = 10000, - eventReadMaxAttempts = 20*/ ) }