【发布时间】:2019-06-10 16:14:31
【问题描述】:
我正在使用 Corda 版本 4。
我的 CorDapp 有四个节点 - 公证节点(验证)、“节点 A”、“节点 B”和“节点 C”。以下是应用程序中定义的流程 -
流程1:“节点A”签署并向“节点B”发送交易请求。 “节点 C”也会收到通知。
以下是我的流程 1 的代码:
val tx = TransactionBuilder(notary).withItems(
StateAndContract(tradeProposal, IOU_CONTRACT_ID),
Command(IOUContract.Commands.Issue(), listOf(tradeProposal.sender.owningKey)))
.addAttachment(secHash)
tx.setTimeWindow(serviceHub.clock.instant(), 180.seconds)
val signedTx = serviceHub.signInitialTransaction(tx)
signedTx.verify(serviceHub)
val NodeBFlow = initiateFlow(NodeB)
val NodeCFlow = initiateFlow(NodeC)
subFlow(FinalityFlow(signedTx, listOf(NodeBFlow ,NodeCFlow )))
return signedTx.tx.outRef<State>(0)
流程 2:“节点 B”批准交易请求,自签名,从 A 获得签名并关闭交易。 “节点 C”也会收到通知。
val tx = TransactionBuilder(notary).
withItems(
latestRecord,
StateAndContract(newState, IOU_CONTRACT_ID),
Command(IOUContract.Commands.Completed(),
newState.participants.map { it.owningKey }))
tx.setTimeWindow(serviceHub.clock.instant(), 600.seconds)
tx.verify(serviceHub)
val partSignedTx = serviceHub.signInitialTransaction(tx)
val NodeAFlow = initiateFlow(newState.sender)
val NodeCFlow = initiateFlow(newState.recipient2)
val fullySignedTx = subFlow(CollectSignaturesFlow(partSignedTx, setOf(NodeAFlow ,NodeCFlow)))
return subFlow(FinalityFlow(fullySignedTx, listOf(NodeAFlow ,NodeCFlow)))
执行流程 1 时出现以下错误 -
Missing signatures on transaction 58C11D for keys: aL9YufujsPipKTb8fjj897654322ogVS1s67PBWD3vn2fGzjUbEnN, by signers: notary
net.corda.core.transactions.SignedTransaction$SignaturesMissingException: Missing signatures on transaction 58C11D for keys: aL9YufujsPipKTb8fjj897654322ogVS1s67PBWD3vn2fGzjUbEnN, by signers: notary
【问题讨论】:
标签: corda