From fa51dd35d4ede6f5ca17425411b2611938f9385d Mon Sep 17 00:00:00 2001 From: Christian Sailer Date: Tue, 28 Aug 2018 13:59:16 +0100 Subject: [PATCH] Comment out Cordform for tools/notarytest. This needs to be converted to groovy/gradle (see https://r3-cev.atlassian.net/browse/ENT-2460) --- .../corda/notarytest/JDBCNotaryCordform.kt | 179 +++++++++--------- .../main/kotlin/net/corda/notarytest/Main.kt | 4 + 2 files changed, 91 insertions(+), 92 deletions(-) diff --git a/tools/notarytest/src/main/kotlin/net/corda/notarytest/JDBCNotaryCordform.kt b/tools/notarytest/src/main/kotlin/net/corda/notarytest/JDBCNotaryCordform.kt index aeed45e07f..9afc8ebd30 100644 --- a/tools/notarytest/src/main/kotlin/net/corda/notarytest/JDBCNotaryCordform.kt +++ b/tools/notarytest/src/main/kotlin/net/corda/notarytest/JDBCNotaryCordform.kt @@ -1,92 +1,87 @@ -/* - * R3 Proprietary and Confidential - * - * Copyright (c) 2018 R3 Limited. All rights reserved. - * - * The intellectual and technical concepts contained herein are proprietary to R3 and its suppliers and are protected by trade secret law. - * - * Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited. - */ - -package net.corda.notarytest - -import net.corda.cordform.CordformContext -import net.corda.cordform.CordformDefinition -import net.corda.cordform.CordformNode -import net.corda.core.identity.CordaX500Name -import net.corda.node.services.Permissions -import net.corda.node.services.config.NotaryConfig -import net.corda.nodeapi.internal.DevIdentityGenerator -import net.corda.testing.node.User -import net.corda.testing.node.internal.demorun.* - -fun main(args: Array) = JDBCNotaryCordform().nodeRunner().deployAndRunNodes() - -internal val notaryDemoUser = User("demou", "demop", setOf(Permissions.all())) - -class JDBCNotaryCordform : CordformDefinition() { - private val clusterName = CordaX500Name("Mysql Notary", "Zurich", "CH") - private val notaryNames = createNotaryNames(3) - - private fun createNotaryNames(clusterSize: Int) = (0 until clusterSize).map { - CordaX500Name("Notary Service $it", "Zurich", "CH") - } - - init { - fun notaryNode(index: Int, configure: CordformNode.() -> Unit) = node { - name(notaryNames[index]) - notary( - NotaryConfig( - validating = true, - custom = true - ) - ) - extraConfig = mapOf("custom" to - mapOf( - "mysql" to mapOf( - "dataSource" to mapOf( - // Update the db address/port accordingly - "jdbcUrl" to "jdbc:mysql://localhost:330${6 + index}/corda?rewriteBatchedStatements=true&useSSL=false&failOverReadOnly=false", - "username" to "corda", - "password" to "awesome", - "autoCommit" to "false") - ), - "graphiteAddress" to "performance-metrics.northeurope.cloudapp.azure.com:2004" - ) - ) - configure() - } - - notaryNode(0) { - p2pPort(10009) - rpcSettings { - address("localhost:10010") - adminAddress("localhost:10110") - } - rpcUsers(notaryDemoUser) - } - notaryNode(1) { - p2pPort(10013) - rpcSettings { - address("localhost:10014") - adminAddress("localhost:10114") - } - rpcUsers(notaryDemoUser) - } - notaryNode(2) { - p2pPort(10017) - rpcSettings { - address("localhost:10018") - adminAddress("localhost:10118") - } - rpcUsers(notaryDemoUser) - } - } - - override fun setup(context: CordformContext) { - DevIdentityGenerator.generateDistributedNotarySingularIdentity( - notaryNames.map { context.baseDirectory(it.toString()) }, - clusterName - ) - } -} \ No newline at end of file +///* +// * R3 Proprietary and Confidential +// * +// * Copyright (c) 2018 R3 Limited. All rights reserved. +// * +// * The intellectual and technical concepts contained herein are proprietary to R3 and its suppliers and are protected by trade secret law. +// * +// * Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited. +// */ +// +//package net.corda.notarytest +// +//import net.corda.cordform.CordformContext +//import net.corda.cordform.CordformDefinition +//import net.corda.cordform.CordformNode +//import net.corda.core.identity.CordaX500Name +//import net.corda.node.services.config.NotaryConfig +//import net.corda.nodeapi.internal.DevIdentityGenerator +// +//fun main(args: Array) = JDBCNotaryCordform().nodeRunner().deployAndRunNodes() +// +//class JDBCNotaryCordform : CordformDefinition() { +// private val clusterName = CordaX500Name("Mysql Notary", "Zurich", "CH") +// private val notaryNames = createNotaryNames(3) +// +// private fun createNotaryNames(clusterSize: Int) = (0 until clusterSize).map { +// CordaX500Name("Notary Service $it", "Zurich", "CH") +// } +// +// init { +// fun notaryNode(index: Int, configure: CordformNode.() -> Unit) = node { +// name(notaryNames[index]) +// notary( +// NotaryConfig( +// validating = true, +// custom = true +// ) +// ) +// extraConfig = mapOf("custom" to +// mapOf( +// "mysql" to mapOf( +// "dataSource" to mapOf( +// // Update the db address/port accordingly +// "jdbcUrl" to "jdbc:mysql://localhost:330${6 + index}/corda?rewriteBatchedStatements=true&useSSL=false&failOverReadOnly=false", +// "username" to "corda", +// "password" to "awesome", +// "autoCommit" to "false") +// ), +// "graphiteAddress" to "performance-metrics.northeurope.cloudapp.azure.com:2004" +// ) +// ) +// configure() +// } +// +// notaryNode(0) { +// p2pPort(10009) +// rpcSettings { +// address("localhost:10010") +// adminAddress("localhost:10110") +// } +// rpcUsers(notaryDemoUser) +// } +// notaryNode(1) { +// p2pPort(10013) +// rpcSettings { +// address("localhost:10014") +// adminAddress("localhost:10114") +// } +// rpcUsers(notaryDemoUser) +// } +// notaryNode(2) { +// p2pPort(10017) +// rpcSettings { +// address("localhost:10018") +// adminAddress("localhost:10118") +// } +// rpcUsers(notaryDemoUser) +// } +// } +// +// override fun setup(context: CordformContext) { +// DevIdentityGenerator.generateDistributedNotarySingularIdentity( +// notaryNames.map { context.baseDirectory(it.toString()) }, +// clusterName +// ) +// } +//} \ No newline at end of file diff --git a/tools/notarytest/src/main/kotlin/net/corda/notarytest/Main.kt b/tools/notarytest/src/main/kotlin/net/corda/notarytest/Main.kt index 90e93a18bf..ceab87d4ab 100644 --- a/tools/notarytest/src/main/kotlin/net/corda/notarytest/Main.kt +++ b/tools/notarytest/src/main/kotlin/net/corda/notarytest/Main.kt @@ -15,7 +15,9 @@ import net.corda.client.rpc.CordaRPCClient import net.corda.core.messaging.CordaRPCOps import net.corda.core.messaging.startFlow import net.corda.core.utilities.NetworkHostAndPort +import net.corda.node.services.Permissions import net.corda.notarytest.service.JDBCLoadTestFlow +import net.corda.testing.node.User import java.util.concurrent.TimeUnit /** The number of test flows to run on each notary node */ @@ -62,3 +64,5 @@ private fun run(rpc: CordaRPCOps, inputStateCount: Int? = null): List { flowDuration } } + +internal val notaryDemoUser = User("demou", "demop", setOf(Permissions.all())) \ No newline at end of file