首页 > 解决方案 > 交易 58C11D 上缺少密钥的签名:DL9YufujsPipKTb8fjj82ogVS1s67PBWD3vn2fGzjUbEnN,签名者:公证人

问题描述

我正在使用 Corda 版本 4。

我的 CorDapp 有四个节点——公证节点(验证)、“节点 A”、“节点 B”和“节点 C”。以下是应用程序中定义的流程 -

流程一:“节点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

解决方案


公证人会抛出该错误,因为 NodeC 包含在 FinalityFlow 中(它将交易发送给公证人),但它不是交易签名者的一部分

如果您想通知节点 C 而不使其成为交易的必需参与者和签署人,您想使用“观察者”类型设置,您可以在此处找到代码示例:

https://docs.corda.net/tutorial-observer-nodes.html

  • R3 的开发者关系

推荐阅读