Add registrations of NodeInterestRate services to support exist IRSDemo

This commit is contained in:
Matthew Nesbit 2016-08-03 13:49:22 +01:00
parent d32db5d08a
commit 9deab37bed
4 changed files with 27 additions and 5 deletions

View File

@ -1,13 +1,14 @@
basedir : "./standalone/node1",
myLegalName : "Node 1",
basedir : "./standalone/nodea",
myLegalName : "Bank A",
nearestCity : "London",
keyStorePassword : "cordacadevpass",
trustStorePassword : "trustpass",
artemisAddress : "localhost:31337",
webAddress : "localhost:31338",
webAddress : "localhost:31339",
hostNotaryServiceLocally: false,
extraAdvertisedServiceIds: "corda.interest_rates",
mapService : {
hostServiceLocally : false,
address : "localhost:12345",
identity : "Corda Name Service"
identity : "Notary Service"
}

View File

@ -0,0 +1,14 @@
basedir : "./standalone/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"
}

View File

@ -1,11 +1,12 @@
basedir : "./standalone/nameserver",
myLegalName : "Corda Name Service",
myLegalName : "Notary Service",
nearestCity : "London",
keyStorePassword : "cordacadevpass",
trustStorePassword : "trustpass",
artemisAddress : "localhost:12345",
webAddress : "localhost:12346",
hostNotaryServiceLocally: true,
extraAdvertisedServiceIds: "",
mapService : {
hostServiceLocally : true,
address : ${artemisAddress},

View File

@ -68,6 +68,7 @@ class FullNodeConfiguration(conf: Config) : NodeConfiguration {
val artemisAddress: HostAndPort by conf
val webAddress: HostAndPort by conf
val hostNotaryServiceLocally: Boolean by conf
val extraAdvertisedServiceIds: String by conf
val mapService: AdvertisedServiceConfigImpl = AdvertisedServiceConfigImpl(conf.getConfig("mapService"))
val clock: Clock = NodeClock()
@ -76,6 +77,11 @@ class FullNodeConfiguration(conf: Config) : NodeConfiguration {
val advertisedServices = mutableSetOf<ServiceType>()
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 networkMapBootstrapIdentity = Party(mapService.identity, generateKeyPair().public)
val networkMapAddress: NodeInfo? = if (mapService.hostServiceLocally) null else NodeInfo(networkMapTarget, networkMapBootstrapIdentity, setOf(NetworkMapService.Type))
return Node(basedir.toAbsolutePath().normalize(),