1, this section targets
We will build a node contains three in this body, a demo of the notary party corda network
Containing the command to deploy in gradle.builde file in our project:
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
nodeDefaults {
projectCordapp { deploy = true }
}
node {
name "O=Notary,L=London,C=GB"
notary = [validating: false]
p2pPort 10000
cordapps = []
rpcSettings {
address("localhost:10001")
adminAddress("localhost:10002")
}
}
node {
name "O=PartyA,L=London,C=GB"
p2pPort 10003
rpcSettings {
address("localhost:10004")
adminAddress("localhost:10005")
}
rpcUsers = [[user: "user1", password: "test", permissions: ["ALL"]]]
}
node {
name "O=PartyB,L=New York,C=US"
p2pPort 10006
rpcSettings {
address("localhost:10007")
adminAddress("localhost:10008")
}
rpcUsers = [[user: "user1", password: "test", permissions: ["ALL"]]]
}
node {
name "O=PartyC,L=Lagos,C=NG"
p2pPort 10009
rpcSettings {
address("localhost:10010")
adminAddress("localhost:10011")
}
rpcUsers = [[user: "user1", password: "test", permissions: ["ALL"]]]
}
}
2, the specific embodiment
Things to do:
- First, set up a test network node
- Start node
- Bonds issued by partyA node to patyB
- View three nodes of the database, see if you can see the state
2.1 & test node deployment
windows under test node deployment & command as follows:
gradle.bat deployNodes
build\nodes\runnodes.bat
Command Linux / macOS under test & deploy nodes as follows:
./gradlew deployNodes
build/nodes/runnodes
Please be patient, I create four nodes took about 58s
If the second command execution time, there has been an error, probably not xterm installed, executed in ubuntu18.04:
sudo apt install xterm
2.2 Bonds issued
Run the following command is issued to PartyB in PartyA number of 99 bonds:
flow start IOUIssueFlow owner: PartyB, amount: 99
Here there has been such an error:
Need IOUState.class added something in a comment:
@BelongsToContract(IOUContract.class)
public class IOUState implements ContractState {
2.3 View Library
Executed in PartyA or PartyB:
run valutQuery contractStateType: bootcamp.IOUState
They will have IOUState, however, PartyC did not have any details regarding IOUState, this is the "only need to know" (tell the truth, I think this is a big drawback)
Only then saved notrary hash, it will not know the specific details of the deal, just to ensure double flowers.
So far, bootcamp completely over, ending Sahua ~
3, summary
Corda is a proprietary distributed system books:
- Node with identification
- Providing distributed data storage model
- Provide privacy p2p communication, because all communications will be encrypted
4, Contact
- Technical Documents
- docs.corda.net
- docs.cncorda.com (Chinese)
- Community Forums:
- Stack Overflow: stackoverflow.com/questions/tagged/corda
- Slack exchange group:
- cordaledger: slack.corda.net
So far, corda Sahua end! ! ! ~~~~~