mirror of
https://github.com/corda/corda.git
synced 2025-06-22 17:09:00 +00:00
Removed unnecessary changes.
This commit is contained in:
committed by
Andras Slemmer
parent
5a4215a312
commit
7a4a1363cb
@ -52,7 +52,7 @@ class ConfigurationException(message: String) : Exception(message)
|
|||||||
* Listed clientAPI classes are assumed to have to take a single APIServer constructor parameter
|
* Listed clientAPI classes are assumed to have to take a single APIServer constructor parameter
|
||||||
* @param clock The clock used within the node and by all protocols etc
|
* @param clock The clock used within the node and by all protocols etc
|
||||||
*/
|
*/
|
||||||
open class Node(dir: Path, val p2pAddr: HostAndPort, configuration: NodeConfiguration,
|
class Node(dir: Path, val p2pAddr: HostAndPort, configuration: NodeConfiguration,
|
||||||
networkMapAddress: NodeInfo?, advertisedServices: Set<ServiceType>,
|
networkMapAddress: NodeInfo?, advertisedServices: Set<ServiceType>,
|
||||||
clock: Clock = NodeClock(),
|
clock: Clock = NodeClock(),
|
||||||
val clientAPIs: List<Class<*>> = listOf()) : AbstractNode(dir, configuration, networkMapAddress, advertisedServices, clock) {
|
val clientAPIs: List<Class<*>> = listOf()) : AbstractNode(dir, configuration, networkMapAddress, advertisedServices, clock) {
|
||||||
|
@ -31,7 +31,6 @@ import com.r3corda.protocols.NotaryProtocol
|
|||||||
import com.r3corda.protocols.TwoPartyTradeProtocol
|
import com.r3corda.protocols.TwoPartyTradeProtocol
|
||||||
import com.typesafe.config.ConfigFactory
|
import com.typesafe.config.ConfigFactory
|
||||||
import joptsimple.OptionParser
|
import joptsimple.OptionParser
|
||||||
import java.io.Serializable
|
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
@ -62,7 +61,6 @@ enum class Role {
|
|||||||
BUYER,
|
BUYER,
|
||||||
SELLER
|
SELLER
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// And this is the directory under the current working directory where each node will create its own server directory,
|
// And this is the directory under the current working directory where each node will create its own server directory,
|
||||||
// which holds things like checkpoints, keys, databases, message logs etc.
|
// which holds things like checkpoints, keys, databases, message logs etc.
|
||||||
@ -145,7 +143,9 @@ fun runTraderDemo(args: Array<String>): Int {
|
|||||||
NodeInfo(ArtemisMessagingService.makeRecipient(theirNetAddr), party, setOf(NetworkMapService.Type))
|
NodeInfo(ArtemisMessagingService.makeRecipient(theirNetAddr), party, setOf(NetworkMapService.Type))
|
||||||
}
|
}
|
||||||
// And now construct then start the node object. It takes a little while.
|
// And now construct then start the node object. It takes a little while.
|
||||||
val node = logElapsedTime("Node startup") { Node(directory, myNetAddr, config, networkMapId, advertisedServices).setup().start() }
|
val node = logElapsedTime("Node startup") {
|
||||||
|
Node(directory, myNetAddr, config, networkMapId, advertisedServices).setup().start()
|
||||||
|
}
|
||||||
|
|
||||||
// What happens next depends on the role. The buyer sits around waiting for a trade to start. The seller role
|
// What happens next depends on the role. The buyer sits around waiting for a trade to start. The seller role
|
||||||
// will contact the buyer and actually make something happen.
|
// will contact the buyer and actually make something happen.
|
||||||
@ -160,7 +160,7 @@ fun runTraderDemo(args: Array<String>): Int {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun runSeller(myAddr: HostAndPort, node: Node, recipient: SingleMessageRecipient) {
|
private fun runSeller(myNetAddr: HostAndPort, node: Node, recipient: SingleMessageRecipient) {
|
||||||
// The seller will sell some commercial paper to the buyer, who will pay with (self issued) cash.
|
// The seller will sell some commercial paper to the buyer, who will pay with (self issued) cash.
|
||||||
//
|
//
|
||||||
// The CP sale transaction comes with a prospectus PDF, which will tag along for the ride in an
|
// The CP sale transaction comes with a prospectus PDF, which will tag along for the ride in an
|
||||||
@ -288,7 +288,7 @@ ${Emoji.renderIfSupported(cpIssuance)}""")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TraderDemoProtocolSeller(val myAddr: HostAndPort,
|
private class TraderDemoProtocolSeller(val myAddress: HostAndPort,
|
||||||
val otherSide: SingleMessageRecipient,
|
val otherSide: SingleMessageRecipient,
|
||||||
val amount: Amount<Issued<Currency>>,
|
val amount: Amount<Issued<Currency>>,
|
||||||
override val progressTracker: ProgressTracker = TraderDemoProtocolSeller.tracker()) : ProtocolLogic<Unit>() {
|
override val progressTracker: ProgressTracker = TraderDemoProtocolSeller.tracker()) : ProtocolLogic<Unit>() {
|
||||||
@ -313,7 +313,7 @@ private class TraderDemoProtocolSeller(val myAddr: HostAndPort,
|
|||||||
override fun call() {
|
override fun call() {
|
||||||
progressTracker.currentStep = ANNOUNCING
|
progressTracker.currentStep = ANNOUNCING
|
||||||
|
|
||||||
val sessionID = sendAndReceive<Long>(DEMO_TOPIC, otherSide, 0, 0, myAddr).validate { it }
|
val sessionID = sendAndReceive<Long>(DEMO_TOPIC, otherSide, 0, 0, myAddress).validate { it }
|
||||||
|
|
||||||
progressTracker.currentStep = SELF_ISSUING
|
progressTracker.currentStep = SELF_ISSUING
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user