Correct TraderDemo after network map changes

Script to run TraderDemo now specified network map service rather than timestamper service.
TraderDemo now explicitly states the services it needs to run. Previously this was implied by whether a timestamper service was specified, and the code was not updated when that change was made.
This commit is contained in:
Ross Nicoll 2016-05-04 17:43:45 +01:00
parent 5eaf86a4b1
commit e433663875
2 changed files with 9 additions and 3 deletions

View File

@ -24,7 +24,7 @@ elif [[ "$mode" == "seller" ]]; then
echo "myLegalName = Bank B" >seller/config echo "myLegalName = Bank B" >seller/config
fi fi
build/install/r3prototyping/bin/r3prototyping --dir=seller --fake-trade-with=localhost --network-address=localhost:31340 --timestamper-identity-file=buyer/identity-public --timestamper-address=localhost build/install/r3prototyping/bin/r3prototyping --dir=seller --fake-trade-with=localhost --network-address=localhost:31340 --network-map-identity-file=buyer/identity-public --network-map-address=localhost
else else
echo "Run like this, one in each tab:" echo "Run like this, one in each tab:"
echo echo

View File

@ -29,6 +29,7 @@ import java.nio.file.Path
import java.nio.file.Paths import java.nio.file.Paths
import java.security.PublicKey import java.security.PublicKey
import java.time.Instant import java.time.Instant
import java.util.*
import kotlin.system.exitProcess import kotlin.system.exitProcess
import kotlin.test.assertEquals import kotlin.test.assertEquals
@ -70,7 +71,7 @@ fun main(args: Array<String>) {
val config = loadConfigFile(configFile) val config = loadConfigFile(configFile)
var advertisedServices: Set<ServiceType> = emptySet() val advertisedServices: Set<ServiceType>
val myNetAddr = HostAndPort.fromString(options.valueOf(networkAddressArg)).withDefaultPort(Node.DEFAULT_PORT) val myNetAddr = HostAndPort.fromString(options.valueOf(networkAddressArg)).withDefaultPort(Node.DEFAULT_PORT)
val listening = options.has(serviceFakeTradesArg) val listening = options.has(serviceFakeTradesArg)
@ -83,8 +84,13 @@ fun main(args: Array<String>) {
val addr = HostAndPort.fromString(options.valueOf(networkMapNetAddr)).withDefaultPort(Node.DEFAULT_PORT) val addr = HostAndPort.fromString(options.valueOf(networkMapNetAddr)).withDefaultPort(Node.DEFAULT_PORT)
val path = Paths.get(options.valueOf(networkMapIdentityFile)) val path = Paths.get(options.valueOf(networkMapIdentityFile))
val party = Files.readAllBytes(path).deserialize<Party>() val party = Files.readAllBytes(path).deserialize<Party>()
advertisedServices = emptySet()
NodeInfo(ArtemisMessagingService.makeRecipient(addr), party, setOf(NetworkMapService.Type)) NodeInfo(ArtemisMessagingService.makeRecipient(addr), party, setOf(NetworkMapService.Type))
} else null } else {
// We must be the network map service
advertisedServices = setOf(NetworkMapService.Type, TimestamperService.Type)
null
}
val node = logElapsedTime("Node startup") { Node(dir, myNetAddr, config, networkMapId, advertisedServices).start() } val node = logElapsedTime("Node startup") { Node(dir, myNetAddr, config, networkMapId, advertisedServices).start() }