extraAdvertisedServiceIds config is now a list of strings, rather than a comma separated string

This commit is contained in:
Shams Asari 2017-02-21 13:57:09 +00:00
parent 33717259bd
commit 7181b697a3
13 changed files with 16 additions and 16 deletions

View File

@ -4,7 +4,7 @@ keyStorePassword : "cordacadevpass"
trustStorePassword : "trustpass"
artemisAddress : "localhost:31337"
webAddress : "localhost:31339"
extraAdvertisedServiceIds: "corda.interest_rates"
extraAdvertisedServiceIds : [ "corda.interest_rates" ]
networkMapService : {
address : "localhost:12345"
legalName : "Network Map Service"

View File

@ -4,7 +4,7 @@ keyStorePassword : "cordacadevpass"
trustStorePassword : "trustpass"
artemisAddress : "localhost:31338"
webAddress : "localhost:31340"
extraAdvertisedServiceIds: "corda.interest_rates"
extraAdvertisedServiceIds : [ "corda.interest_rates" ]
networkMapService : {
address : "localhost:12345"
legalName : "Network Map Service"

View File

@ -4,5 +4,5 @@ keyStorePassword : "cordacadevpass"
trustStorePassword : "trustpass"
artemisAddress : "localhost:12345"
webAddress : "localhost:12346"
extraAdvertisedServiceIds: "corda.notary.validating"
extraAdvertisedServiceIds : [ "corda.notary.validating" ]
useHTTPS : false

View File

@ -40,7 +40,7 @@ NetworkMapService plus Simple Notary configuration file.
trustStorePassword : "trustpass"
artemisAddress : "localhost:12345"
webAddress : "localhost:12346"
extraAdvertisedServiceIds: ""
extraAdvertisedServiceIds : []
useHTTPS : false
devMode : true
// Certificate signing service will be hosted by R3 in the near future.

View File

@ -4,5 +4,5 @@ keyStorePassword : "cordacadevpass"
trustStorePassword : "trustpass"
artemisAddress : "my-network-map:10000"
webAddress : "localhost:10001"
extraAdvertisedServiceIds: ""
extraAdvertisedServiceIds : []
useHTTPS : false

View File

@ -10,7 +10,7 @@ dataSourceProperties : {
}
artemisAddress : "my-corda-node:10002"
webAddress : "localhost:10003"
extraAdvertisedServiceIds: "corda.interest_rates"
extraAdvertisedServiceIds : [ "corda.interest_rates" ]
networkMapService : {
address : "my-network-map:10000"
legalName : "Network Map Service"

View File

@ -17,13 +17,13 @@ For ``SimpleNotaryService``, simply add the following service id to the list of
.. parsed-literal::
extraAdvertisedServiceIds: "net.corda.notary.simple"
extraAdvertisedServiceIds : [ "net.corda.notary.simple" ]
For ``ValidatingNotaryService``, it is:
.. parsed-literal::
extraAdvertisedServiceIds: "net.corda.notary.validating"
extraAdvertisedServiceIds : [ "net.corda.notary.validating" ]
Setting up a ``RaftValidatingNotaryService`` is currently slightly more involved and is not recommended for prototyping
purposes. There is work in progress to simplify it. To see it in action, however, you can try out the :ref:`notary-demo`.

View File

@ -207,7 +207,7 @@ class Node {
*/
private void installConfig() {
// Adding required default values
config = config.withValue('extraAdvertisedServiceIds', ConfigValueFactory.fromAnyRef(advertisedServices.join(',')))
config = config.withValue('extraAdvertisedServiceIds', ConfigValueFactory.fromIterable(advertisedServices))
if (notaryClusterAddresses.size() > 0) {
config = config.withValue('notaryClusterAddresses', ConfigValueFactory.fromIterable(notaryClusterAddresses))
}

View File

@ -147,7 +147,9 @@ Corda will now exit...""")
}
private fun printPluginsAndServices(node: Node) {
node.configuration.extraAdvertisedServiceIds.let { if (it.isNotEmpty()) printBasicNodeInfo("Providing network services", it) }
node.configuration.extraAdvertisedServiceIds.let {
if (it.isNotEmpty()) printBasicNodeInfo("Providing network services", it.joinToString())
}
val plugins = node.pluginRegistries
.map { it.javaClass.name }
.filterNot { it.startsWith("net.corda.node.") || it.startsWith("net.corda.core.") }

View File

@ -352,7 +352,7 @@ open class DriverDSL(
"myLegalName" to name,
"artemisAddress" to messagingAddress.toString(),
"webAddress" to apiAddress.toString(),
"extraAdvertisedServiceIds" to advertisedServices.joinToString(","),
"extraAdvertisedServiceIds" to advertisedServices.map { it.toString() },
"networkMapService" to mapOf(
"address" to networkMapAddress.toString(),
"legalName" to networkMapLegalName
@ -463,7 +463,6 @@ open class DriverDSL(
// node port numbers to be shifted, so all demos and docs need to be updated accordingly.
"webAddress" to apiAddress,
"artemisAddress" to networkMapAddress.toString(),
"extraAdvertisedServiceIds" to "",
"useTestClock" to useTestClock
)
)

View File

@ -69,7 +69,7 @@ class FullNodeConfiguration(override val baseDirectory: Path, val config: Config
// TODO This field is slightly redundant as artemisAddress is sufficient to hold the address of the node's MQ broker.
// Instead this should be a Boolean indicating whether that broker is an internal one started by the node or an external one
val messagingServerAddress: HostAndPort? by config.getOrElse { null }
val extraAdvertisedServiceIds: String by config
val extraAdvertisedServiceIds: List<String> = config.getListOrElse<String>("extraAdvertisedServiceIds") { emptyList() }
val useTestClock: Boolean by config.getOrElse { false }
val notaryNodeAddress: HostAndPort? by config.getOrElse { null }
val notaryClusterAddresses: List<HostAndPort> = config
@ -81,7 +81,6 @@ class FullNodeConfiguration(override val baseDirectory: Path, val config: Config
require(!useTestClock || devMode) { "Cannot use test clock outside of dev mode" }
val advertisedServices = extraAdvertisedServiceIds
.split(",")
.filter(String::isNotBlank)
.map { ServiceInfo.parse(it) }
.toMutableSet()

View File

@ -1 +1 @@
gradlePluginsVersion=0.8
gradlePluginsVersion=0.8.1

View File

@ -121,7 +121,7 @@ abstract class NodeBasedTest {
configOverrides = mapOf(
"myLegalName" to legalName,
"artemisAddress" to freeLocalHostAndPort().toString(),
"extraAdvertisedServiceIds" to advertisedServices.joinToString(","),
"extraAdvertisedServiceIds" to advertisedServices.map { it.toString() },
"rpcUsers" to rpcUsers.map {
mapOf(
"user" to it.username,