視頻地址:https://www.bilibili.com/video/av67440579/?p=13的java
咱們將在本機構建一個含有三個節點、一個公證方的demo的corda網絡node
在咱們工程項目的gradle.builde文件中含有部署的命令:shell
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"]]] } }
要作的事情:ubuntu
windows下部署&測試節點的的命令以下:windows
gradle.bat deployNodes build\nodes\runnodes.bat
Linux/macOS下部署&測試節點的命令以下:網絡
./gradlew deployNodes build/nodes/runnodes
請耐心等待,我創建四個節點大概花了58sapp
若是執行第二條命令的時候,出現了報錯,極可能是未安裝xterm,請在ubuntu18.04下執行:分佈式
sudo apt install xterm
在PartyA下執行以下命令向PartyB發佈數量爲99的債券:ide
flow start IOUIssueFlow owner: PartyB, amount: 99
這裏出現了這樣的報錯:測試
須要在IOUState.class中補上一個註釋:
@BelongsToContract(IOUContract.class) public class IOUState implements ContractState {
在PartyA或者PartyB下執行:
run vaultQuery contractStateType: bootcamp.IOUState
他們必定會擁有IOUState,可是,PartyC中沒有任何有關於IOUState的細節,這就是「僅須要知道」(實話實話,我以爲這是一個很大的缺陷)
而後notrary中保存的只有哈希,它也不會知道交易的具體細節,只是爲了保證雙花。
至此,bootcamp徹底結束,撒花結束~
Corda是一個私有分佈式帳本系統:
至此,corda撒花完結!!!~~~~~