ENT-1245: Cleanup: remove unused node from notary demo

This commit is contained in:
Andrius Dagys 2018-09-14 11:42:47 +01:00
parent 137f7664c1
commit 160bc147ed
3 changed files with 6 additions and 47 deletions

View File

@ -2,17 +2,13 @@ Notary demo
-----------
This demo shows a party getting transactions notarised by either a single-node or a distributed notary service.
All versions of the demo start two counterparty nodes.
One of the counterparties will generate transactions that transfer a self-issued asset to the other party and submit
them for notarisation.
The Raft (https://raft.github.io/) version of the demo will start three distributed notary nodes.
The BFT SMaRt (https://bft-smart.github.io/library/) version of the demo will start four distributed notary nodes.
The output will display a list of notarised transaction IDs and corresponding signer public keys. In the Raft distributed notary,
every node in the cluster can service client requests, and one signature is sufficient to satisfy the notary composite key requirement.
In the BFT SMaRt distributed notary, three signatures are required.
In the BFT-SMaRt distributed notary, three signatures are required.
You will notice that successive transactions get signed by different members of the cluster (usually allocated in a random order).
To run the Raft version of the demo from the command line in Unix:
@ -22,7 +18,7 @@ To run the Raft version of the demo from the command line in Unix:
Single notaries).
2. Run ``./samples/notary-demo/build/nodes/nodesRaft/runnodes``, which will start the nodes in separate terminal windows/tabs.
Wait until a "Node started up and registered in ..." message appears on each of the terminals
3. Run ``./gradlew samples:notary-demo:notarise`` to make a call to the "Party" node to initiate notarisation requests
3. Run ``./gradlew samples:notary-demo:notarise`` to make a call to the "Alice Corp" node to initiate notarisation requests
In a few seconds you will see a message "Notarised 10 transactions" with a list of transaction ids and the signer public keys
To run from the command line in Windows:
@ -32,7 +28,7 @@ To run from the command line in Windows:
Single notaries).
2. Run ``samples\notary-demo\build\nodes\nodesRaft\runnodes``, which will start the nodes in separate terminal windows/tabs.
Wait until a "Node started up and registered in ..." message appears on each of the terminals
3. Run ``gradlew samples:notary-demo:notarise`` to make a call to the "Party" node to initiate notarisation requests
3. Run ``gradlew samples:notary-demo:notarise`` to make a call to the "Alice Corp" node to initiate notarisation requests
In a few seconds you will see a message "Notarised 10 transactions" with a list of transaction ids and the signer public keys
To run the BFT SMaRt notary demo, use ``nodesBFT`` instead of ``nodesRaft`` in the path (you will see messages from notary nodes

View File

@ -62,14 +62,6 @@ task deployNodesSingle(type: Cordform, dependsOn: 'jar') {
}
rpcUsers = [[user: "demou", password: "demop", permissions: ["ALL"]]]
}
node {
name "O=Bob Plc,L=Rome,C=IT"
p2pPort 10005
rpcSettings {
address "localhost:10006"
adminAddress "localhost:10106"
}
}
node {
name "O=Notary Service,L=Zurich,C=CH"
p2pPort 10009
@ -95,14 +87,6 @@ task deployNodesCustom(type: Cordform, dependsOn: 'jar') {
}
rpcUsers = [[user: "demou", password: "demop", permissions: ["ALL"]]]
}
node {
name "O=Bob Plc,L=Rome,C=IT"
p2pPort 10005
rpcSettings {
address "localhost:10006"
adminAddress "localhost:10106"
}
}
node {
name "O=Notary Service,L=Zurich,C=CH"
p2pPort 10009
@ -128,14 +112,6 @@ task deployNodesRaft(type: Cordform, dependsOn: 'jar') {
}
rpcUsers = [[user: "demou", password: "demop", permissions: ["ALL"]]]
}
node {
name "O=Bob Plc,L=Rome,C=IT"
p2pPort 10005
rpcSettings {
address "localhost:10006"
adminAddress "localhost:10106"
}
}
node {
name "O=Notary Service 0,L=Zurich,C=CH"
p2pPort 10009
@ -200,14 +176,6 @@ task deployNodesBFT(type: Cordform, dependsOn: 'jar') {
}
rpcUsers = [[user: "demou", password: "demop", permissions: ["ALL"]]]
}
node {
name "O=Bob Plc,L=Rome,C=IT"
p2pPort 10005
rpcSettings {
address "localhost:10006"
adminAddress "localhost:10106"
}
}
node {
name "O=Notary Service 0,L=Zurich,C=CH"
p2pPort 10009

View File

@ -3,7 +3,6 @@ package net.corda.notarydemo
import net.corda.client.rpc.CordaRPCClient
import net.corda.core.crypto.CompositeKey
import net.corda.core.crypto.toStringShort
import net.corda.core.identity.PartyAndCertificate
import net.corda.core.messaging.CordaRPCOps
import net.corda.core.messaging.startFlow
import net.corda.core.transactions.SignedTransaction
@ -12,6 +11,7 @@ import net.corda.core.utilities.getOrThrow
import net.corda.notarydemo.flows.DummyIssueAndMove
import net.corda.notarydemo.flows.RPCStartableNotaryFlowClient
import net.corda.testing.core.BOB_NAME
import net.corda.testing.core.TestIdentity
import java.util.concurrent.Future
fun main(args: Array<String>) {
@ -29,13 +29,8 @@ private class NotaryDemoClientApi(val rpc: CordaRPCOps) {
checkNotNull(id) { "No unique notary identity, try cleaning the node directories." }
}
private val counterparty by lazy {
val parties = rpc.networkMapSnapshot()
parties.fold(ArrayList<PartyAndCertificate>()) { acc, elem ->
acc.addAll(elem.legalIdentitiesAndCerts.filter { it.name == BOB_NAME })
acc
}.single().party
}
/** A dummy identity. */
private val counterparty = TestIdentity(BOB_NAME).party
/** Makes calls to the node rpc to start transaction notarisation. */
fun notarise(count: Int) {