Clean up messaging/RPC port configuration and docs (#296)

* Non-ssl artemis acceptor for RPC connection. (#271)

* New non-ssl acceptor in artemis server for RPC connection.

* Rename artemisAddress with messagingAddress

Rename artemisAddress with messagingAddress so that the node configuration file properties match
the code variable names.
Rename artemisPort to messagingPort in Gradle configuration to match node configuration naming.

* Add rpcPort configuration option for Gradle

* Update docs to reflect changes to RPC port configuration

* Renumber ports in example CorDapp to match numbering used elsewhere

* Restructure upgrade guide

* added config file checks on corda startup to make the upgrade path a bit smoother.
This commit is contained in:
Ross Nicoll
2017-03-17 10:32:14 +00:00
committed by Patrick Kuo
parent eb21458885
commit 486368d926
63 changed files with 402 additions and 366 deletions

View File

@ -81,16 +81,17 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['build']) {
name "Notary"
nearestCity "London"
advertisedServices = ["corda.notary.validating"]
artemisPort 10002
webPort 10003
p2pPort 10002
webPort 10004
cordapps = []
}
node {
name "Bank A"
nearestCity "London"
advertisedServices = []
artemisPort 10004
webPort 10005
p2pPort 10005
rpcPort 10006
webPort 10007
cordapps = []
rpcUsers = ext.rpcUsers
}
@ -98,8 +99,9 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['build']) {
name "Bank B"
nearestCity "New York"
advertisedServices = []
artemisPort 10006
webPort 10007
p2pPort 10008
rpcPort 10009
webPort 10010
cordapps = []
rpcUsers = ext.rpcUsers
}
@ -107,8 +109,8 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['build']) {
name "BankOfCorda"
nearestCity "London"
advertisedServices = []
artemisPort 10008
webPort 10009
p2pPort 10011
webPort 10012
cordapps = []
}
}

View File

@ -27,7 +27,7 @@ class TraderDemoTest : NodeBasedTest() {
).getOrThrow()
val (nodeARpc, nodeBRpc) = listOf(nodeA, nodeB).map {
val client = CordaRPCClient(it.configuration.artemisAddress, it.configuration)
val client = CordaRPCClient(it.configuration.rpcAddress!!)
client.start(demoUser[0].username, demoUser[0].password).proxy()
}

View File

@ -31,7 +31,6 @@ private class TraderDemo {
fun main(args: Array<String>) {
val parser = OptionParser()
val certsPath = parser.accepts("certificates").withRequiredArg()
val roleArg = parser.accepts("role").withRequiredArg().ofType(Role::class.java).required()
val options = try {
@ -46,13 +45,13 @@ private class TraderDemo {
// will contact the buyer and actually make something happen.
val role = options.valueOf(roleArg)!!
if (role == Role.BUYER) {
val host = HostAndPort.fromString("localhost:10004")
CordaRPCClient(host, sslConfigFor("BankA", options.valueOf(certsPath))).use("demo", "demo") {
val host = HostAndPort.fromString("localhost:10006")
CordaRPCClient(host).use("demo", "demo") {
TraderDemoClientApi(this).runBuyer()
}
} else {
val host = HostAndPort.fromString("localhost:10006")
CordaRPCClient(host, sslConfigFor("BankB", options.valueOf(certsPath))).use("demo", "demo") {
val host = HostAndPort.fromString("localhost:10009")
CordaRPCClient(host).use("demo", "demo") {
TraderDemoClientApi(this).runSeller(1000.DOLLARS, "Bank A")
}
}
@ -66,13 +65,4 @@ private class TraderDemo {
""".trimIndent())
parser.printHelpOn(System.out)
}
// TODO: Take this out once we have a dedicated RPC port and allow SSL on it to be optional.
private fun sslConfigFor(nodename: String, certsPath: String?): SSLConfiguration {
return object : SSLConfiguration {
override val keyStorePassword: String = "cordacadevpass"
override val trustStorePassword: String = "trustpass"
override val certificatesDirectory: Path = if (certsPath != null) Paths.get(certsPath) else Paths.get("build") / "nodes" / nodename / "certificates"
}
}
}