diff --git a/config/dev/generalnodea.conf b/config/dev/generalnodea.conf index 0926b8410c..13bd532233 100644 --- a/config/dev/generalnodea.conf +++ b/config/dev/generalnodea.conf @@ -1,15 +1,11 @@ -basedir : "./nodea", -myLegalName : "Bank A", -nearestCity : "London", -keyStorePassword : "cordacadevpass", -trustStorePassword : "trustpass", -artemisAddress : "localhost:31337", -webAddress : "localhost:31339", -hostNotaryServiceLocally: false, -extraAdvertisedServiceIds: "corda.interest_rates", -mapService : { - hostServiceLocally : false, - address : "localhost:12345", - identity : "Notary Service" -} +basedir : "./nodea" +myLegalName : "Bank A" +nearestCity : "London" +keyStorePassword : "cordacadevpass" +trustStorePassword : "trustpass" +artemisAddress : "localhost:31337" +webAddress : "localhost:31339" +hostNotaryServiceLocally: false +extraAdvertisedServiceIds: "corda.interest_rates" +networkMapAddress : "localhost:12345" useHTTPS : false diff --git a/config/dev/generalnodeb.conf b/config/dev/generalnodeb.conf index 61fd9472b7..b0952a2aef 100644 --- a/config/dev/generalnodeb.conf +++ b/config/dev/generalnodeb.conf @@ -1,15 +1,11 @@ -basedir : "./nodeb", -myLegalName : "Bank B", -nearestCity : "London", -keyStorePassword : "cordacadevpass", -trustStorePassword : "trustpass", -artemisAddress : "localhost:31338", -webAddress : "localhost:31340", -hostNotaryServiceLocally: false, -extraAdvertisedServiceIds: "corda.interest_rates", -mapService : { - hostServiceLocally : false, - address : "localhost:12345", - identity : "Notary Service" -} +basedir : "./nodeb" +myLegalName : "Bank B" +nearestCity : "London" +keyStorePassword : "cordacadevpass" +trustStorePassword : "trustpass" +artemisAddress : "localhost:31338" +webAddress : "localhost:31340" +hostNotaryServiceLocally: false +extraAdvertisedServiceIds: "corda.interest_rates" +networkMapAddress : "localhost:12345" useHTTPS : false diff --git a/config/dev/nameservernode.conf b/config/dev/nameservernode.conf index 23665e07b9..e760a52f5f 100644 --- a/config/dev/nameservernode.conf +++ b/config/dev/nameservernode.conf @@ -1,15 +1,10 @@ -basedir : "./nameserver", -myLegalName : "Notary Service", -nearestCity : "London", -keyStorePassword : "cordacadevpass", -trustStorePassword : "trustpass", -artemisAddress : "localhost:12345", -webAddress : "localhost:12346", -hostNotaryServiceLocally: true, -extraAdvertisedServiceIds: "", -mapService : { - hostServiceLocally : true, - address : ${artemisAddress}, - identity : ${myLegalName} -} +basedir : "./nameserver" +myLegalName : "Notary Service" +nearestCity : "London" +keyStorePassword : "cordacadevpass" +trustStorePassword : "trustpass" +artemisAddress : "localhost:12345" +webAddress : "localhost:12346" +hostNotaryServiceLocally: true +extraAdvertisedServiceIds: "" useHTTPS : false \ No newline at end of file diff --git a/docs/source/corda-configuration-files.rst b/docs/source/corda-configuration-files.rst index 293bae6559..f1437cc4dc 100644 --- a/docs/source/corda-configuration-files.rst +++ b/docs/source/corda-configuration-files.rst @@ -40,11 +40,7 @@ General node configuration file for hosting the IRSDemo services. webAddress : "localhost:31339" hostNotaryServiceLocally: false extraAdvertisedServiceIds: "corda.interest_rates" - mapService : { - hostServiceLocally : false - address : "localhost:12345" - identity : "Notary Service" - } + networkMapAddress : "localhost:12345" useHTTPS : false NetworkMapService plus Simple Notary configuration file. @@ -60,11 +56,6 @@ NetworkMapService plus Simple Notary configuration file. webAddress : "localhost:12346" hostNotaryServiceLocally: true extraAdvertisedServiceIds: "" - mapService : { - hostServiceLocally : true - address : ${artemisAddress} - identity : ${myLegalName} - } useHTTPS : false Configuration File Fields @@ -103,11 +94,7 @@ Configuration File Fields :extraAdvertisedServiceIds: A list of ServiceType id strings to be advertised to the NetworkMapService and thus be available when other nodes query the NetworkMapCache for supporting nodes. This can also include plugin services loaded from .jar files in the -:mapService.hostServiceLocally: If true the node is declaring itself as the NetworkMapService host. Otherwise the configuration below is the remote connection details for the node to connect to the NetworkMapService. - -:mapService.address: If the node is hosting the NetworkMapService this should be exactly equal to the artemisAddress (hence $ substitution above). Otherwise this value is the remote HostAndPort string for the ArtemisMQ service on the hosting node. - -:mapService.identity: If the node is hosting the NetworkMapService this should be exactly equal to the myLegalName (hence $ substitution above). Otherwise this value must match the myLegalName of the hosting node. +:networkMapAddress: If `null`, or missing the node is declaring itself as the NetworkMapService host. Otherwise the configuration value is the remote HostAndPort string for the ArtemisMQ service on the hosting node. :useHTTPS: If false the node's web server will be plain HTTP. If true the node will use the same certificate and private key from the ``/certificates/sslkeystore.jks`` file as the ArtemisMQ port for HTTPS. If HTTPS is enabled then unencrypted HTTP traffic to the node's **webAddress** port is not supported. diff --git a/node/src/main/kotlin/com/r3corda/node/services/config/NodeConfiguration.kt b/node/src/main/kotlin/com/r3corda/node/services/config/NodeConfiguration.kt index 0e3cf9e3bd..4911de67d7 100644 --- a/node/src/main/kotlin/com/r3corda/node/services/config/NodeConfiguration.kt +++ b/node/src/main/kotlin/com/r3corda/node/services/config/NodeConfiguration.kt @@ -90,12 +90,6 @@ class NodeConfigurationFromConfig(val config: Config = ConfigFactory.load()) : N override val dataSourceProperties: Properties by config } -class NameServiceConfig(conf: Config) { - val hostServiceLocally: Boolean by conf - val address: HostAndPort by conf - val identity: String by conf -} - class FullNodeConfiguration(conf: Config) : NodeConfiguration { val basedir: Path by conf override val myLegalName: String by conf @@ -108,28 +102,26 @@ class FullNodeConfiguration(conf: Config) : NodeConfiguration { val artemisAddress: HostAndPort by conf val webAddress: HostAndPort by conf val messagingServerAddress: HostAndPort? = if (conf.hasPath("messagingServerAddress")) HostAndPort.fromString(conf.getString("messagingServerAddress")) else null + val networkMapAddress: HostAndPort? = if (conf.hasPath("networkMapAddress")) HostAndPort.fromString(conf.getString("networkMapAddress")) else null val hostNotaryServiceLocally: Boolean by conf val extraAdvertisedServiceIds: String by conf - val mapService: NameServiceConfig = NameServiceConfig(conf.getConfig("mapService")) val clock: Clock = NodeClock() fun createNode(): Node { - val networkMapTarget = ArtemisMessagingClient.makeNetworkMapAddress(mapService.address) val advertisedServices = mutableSetOf() - if (mapService.hostServiceLocally) advertisedServices.add(NetworkMapService.Type) if (hostNotaryServiceLocally) advertisedServices.add(SimpleNotaryService.Type) if (!extraAdvertisedServiceIds.isNullOrEmpty()) { for (serviceId in extraAdvertisedServiceIds.split(",")) { advertisedServices.add(object : ServiceType(serviceId) {}) } } - - val networkMapAddress: SingleMessageRecipient? = if (mapService.hostServiceLocally) null else networkMapTarget + if (networkMapAddress == null) advertisedServices.add(NetworkMapService.Type) + val networkMapMessageAddress: SingleMessageRecipient? = if (networkMapAddress == null) null else ArtemisMessagingClient.makeNetworkMapAddress(networkMapAddress) return Node(basedir.toAbsolutePath().normalize(), artemisAddress, webAddress, this, - networkMapAddress, + networkMapMessageAddress, advertisedServices, clock, messagingServerAddress