corda - 交易 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
解决方案
公证人会抛出该错误,因为 NodeC 包含在 FinalityFlow 中(它将交易发送给公证人),但它不是交易签名者的一部分
如果您想通知节点 C 而不使其成为交易的必需参与者和签署人,您想使用“观察者”类型设置,您可以在此处找到代码示例:
https://docs.corda.net/tutorial-observer-nodes.html
- R3 的开发者关系
推荐阅读
- excel - 如果第一组的最后一个数字是 x 则
- javascript - 如何停止 render() 函数,直到所有状态都被更新?
- r - 用R中的伽马不完全函数计算双积分
- pimcore - Pimcore:更新到 Pimcore 4 后无法使用 Pimcore\Model\Object
- r - 如何在 R 的 emmeans 包中计算 SE
- javascript - PrimeNG FullCalendar 不工作,无法找到
- openid-connect - OIDC 登录重定向返回 500 错误 (signin-oidc)
- midi - 无法使用 music21 库在 Python 中解析 MIDI 文件
- css - 如何让 CSS 溢出和高度:计算在可调整大小的 div 中工作
- c# - 我想制作一个我自己的按钮,里面有两个其他按钮,我想让它们透明但透明度不起作用