diff --git a/src/main/kotlin/core/node/Node.kt b/src/main/kotlin/core/node/Node.kt index b9709aa764..bc7f0ddaed 100644 --- a/src/main/kotlin/core/node/Node.kt +++ b/src/main/kotlin/core/node/Node.kt @@ -25,8 +25,6 @@ import java.security.KeyPairGenerator import java.util.* import java.util.concurrent.Executors -val DEFAULT_PORT = 31337 - class ConfigurationException(message: String) : Exception(message) // TODO: Split this into a regression testing environment @@ -194,5 +192,8 @@ class Node(val dir: Path, val myNetAddr: HostAndPort, val configuration: NodeCon companion object { val PRIVATE_KEY_FILE_NAME = "identity-private-key" val PUBLIC_IDENTITY_FILE_NAME = "identity-public" + + /** The port that is used by default if none is specified. As you know, 31337 is the most elite number. */ + val DEFAULT_PORT = 31337 } } \ No newline at end of file diff --git a/src/main/kotlin/core/node/TraderDemo.kt b/src/main/kotlin/core/node/TraderDemo.kt index 339dc034a4..61a47be4d1 100644 --- a/src/main/kotlin/core/node/TraderDemo.kt +++ b/src/main/kotlin/core/node/TraderDemo.kt @@ -89,11 +89,11 @@ fun main(args: Array) { val config = loadConfigFile(configFile) - val myNetAddr = HostAndPort.fromString(options.valueOf(networkAddressArg)).withDefaultPort(DEFAULT_PORT) + val myNetAddr = HostAndPort.fromString(options.valueOf(networkAddressArg)).withDefaultPort(Node.DEFAULT_PORT) val listening = options.has(serviceFakeTradesArg) val timestamperId = if (options.has(timestamperIdentityFile)) { - val addr = HostAndPort.fromString(options.valueOf(timestamperNetAddr)).withDefaultPort(DEFAULT_PORT) + val addr = HostAndPort.fromString(options.valueOf(timestamperNetAddr)).withDefaultPort(Node.DEFAULT_PORT) val path = Paths.get(options.valueOf(timestamperIdentityFile)) val party = Files.readAllBytes(path).deserialize(includeClassName = true) LegallyIdentifiableNode(ArtemisMessagingService.makeRecipient(addr), party) @@ -143,7 +143,7 @@ fun main(args: Array) { println("Need the --fake-trade-with command line argument") System.exit(1) } - val peerAddr = HostAndPort.fromString(options.valuesOf(fakeTradeWithArg).single()).withDefaultPort(DEFAULT_PORT) + val peerAddr = HostAndPort.fromString(options.valuesOf(fakeTradeWithArg).single()).withDefaultPort(Node.DEFAULT_PORT) val otherSide = ArtemisMessagingService.makeRecipient(peerAddr) node.net.runOnNextMessage("test.junktrade.initiate") { msg -> val sessionID = msg.data.deserialize()