如何正确 运行 corda kotlin 示例
How to run corda kotlin example correctly
问题:
我正在尝试 Corda 官方文档 hello word 应用程序。部署 CorDapp 后,我发布了
start IOUFlow iouValue: 99, otherParty: "O=PartyB,L=New York,C=US"
A 方的这个命令。之后我尝试通过在 A 方和 B 方发出这个命令来检查分类帐状态。
run vaultQuery contractStateType: com.template.states.IOUState
但它给出了与这样的公证人相同的输出。
states: []
statesMetadata: []
totalStatesAvailable: -1
stateTypes: "UNCONSUMED"
otherResults: []
但是输出应该是这样的。
states:
- state:
data:
value: 99
lender: "C=GB,L=London,O=PartyA"
borrower: "C=US,L=New York,O=PartyB"
participants:
- "C=GB,L=London,O=PartyA"
- "C=US,L=New York,O=PartyB"
contract: "com.template.contract.IOUContract"
notary: "C=GB,L=London,O=Notary"
encumbrance: null
constraint:
attachmentId: "F578320232CAB87BB1E919F3E5DB9D81B7346F9D7EA6D9155DC0F7BA8E472552"
ref:
txhash: "5CED068E790A347B0DD1C6BB5B2B463406807F95E080037208627565E6A2103B"
index: 0
statesMetadata:
- ref:
txhash: "5CED068E790A347B0DD1C6BB5B2B463406807F95E080037208627565E6A2103B"
index: 0
contractStateClassName: "com.template.state.IOUState"
recordedTime: 1506415268.875000000
consumedTime: null
status: "UNCONSUMED"
notary: "C=GB,L=London,O=Notary"
lockId: null
lockUpdateTime: 1506415269.548000000
totalStatesAvailable: -1
stateTypes: "UNCONSUMED"
otherResults: []
这是我的 build.gradle 任务 deployNodes。
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
nodeDefaults {
projectCordapp {
deploy = true
}
cordapp project(':contracts')
cordapp project(':workflows')
}
directory "./build/nodes"
node {
name "O=Notary,L=London,C=GB"
notary = [validating : true]
p2pPort 10002
rpcSettings {
address("localhost:10003")
adminAddress("localhost:10043")
}
}
node {
name "O=PartyA,L=London,C=GB"
p2pPort 10005
rpcSettings {
address("localhost:10006")
adminAddress("localhost:10046")
}
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}
node {
name "O=PartyB,L=New York,C=US"
p2pPort 10008
rpcSettings {
address("localhost:10009")
adminAddress("localhost:10049")
}
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}
}
我尝试了很多方法在互联网上找到这个问题的解决方案,但我无法这样做,因为我是 Corda 的新手。有人可以帮我解决这个问题吗?非常感谢。
如果屏幕上没有显示任何内容,则流程未完成。
检查您的节点日志(在 build/nodes/PartyA/logs
内)。
您还可以在调试模式下启动节点 (https://docs.corda.net/node-commandline.html#enabling-remote-debugging) 并在您的代码上放置断点以查看其失败的位置。
问题:
我正在尝试 Corda 官方文档 hello word 应用程序。部署 CorDapp 后,我发布了
start IOUFlow iouValue: 99, otherParty: "O=PartyB,L=New York,C=US"
A 方的这个命令。之后我尝试通过在 A 方和 B 方发出这个命令来检查分类帐状态。
run vaultQuery contractStateType: com.template.states.IOUState
但它给出了与这样的公证人相同的输出。
states: []
statesMetadata: []
totalStatesAvailable: -1
stateTypes: "UNCONSUMED"
otherResults: []
但是输出应该是这样的。
states:
- state:
data:
value: 99
lender: "C=GB,L=London,O=PartyA"
borrower: "C=US,L=New York,O=PartyB"
participants:
- "C=GB,L=London,O=PartyA"
- "C=US,L=New York,O=PartyB"
contract: "com.template.contract.IOUContract"
notary: "C=GB,L=London,O=Notary"
encumbrance: null
constraint:
attachmentId: "F578320232CAB87BB1E919F3E5DB9D81B7346F9D7EA6D9155DC0F7BA8E472552"
ref:
txhash: "5CED068E790A347B0DD1C6BB5B2B463406807F95E080037208627565E6A2103B"
index: 0
statesMetadata:
- ref:
txhash: "5CED068E790A347B0DD1C6BB5B2B463406807F95E080037208627565E6A2103B"
index: 0
contractStateClassName: "com.template.state.IOUState"
recordedTime: 1506415268.875000000
consumedTime: null
status: "UNCONSUMED"
notary: "C=GB,L=London,O=Notary"
lockId: null
lockUpdateTime: 1506415269.548000000
totalStatesAvailable: -1
stateTypes: "UNCONSUMED"
otherResults: []
这是我的 build.gradle 任务 deployNodes。
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
nodeDefaults {
projectCordapp {
deploy = true
}
cordapp project(':contracts')
cordapp project(':workflows')
}
directory "./build/nodes"
node {
name "O=Notary,L=London,C=GB"
notary = [validating : true]
p2pPort 10002
rpcSettings {
address("localhost:10003")
adminAddress("localhost:10043")
}
}
node {
name "O=PartyA,L=London,C=GB"
p2pPort 10005
rpcSettings {
address("localhost:10006")
adminAddress("localhost:10046")
}
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}
node {
name "O=PartyB,L=New York,C=US"
p2pPort 10008
rpcSettings {
address("localhost:10009")
adminAddress("localhost:10049")
}
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}
}
我尝试了很多方法在互联网上找到这个问题的解决方案,但我无法这样做,因为我是 Corda 的新手。有人可以帮我解决这个问题吗?非常感谢。
如果屏幕上没有显示任何内容,则流程未完成。
检查您的节点日志(在 build/nodes/PartyA/logs
内)。
您还可以在调试模式下启动节点 (https://docs.corda.net/node-commandline.html#enabling-remote-debugging) 并在您的代码上放置断点以查看其失败的位置。