我正在研究一个涉及三个参与方的用例,比如说PartyA,PartyB和PartyC。
在这种情况下,
在第三种情况下,如何从原始发行方PartyA收集签名以使流程正常进行?
流程中的代码就是这个(我以PartyB的身份出售)
val newOwnerFlow = initiateFlow(PartyC)
progressTracker.currentStep = GATHERING_SIGS
println("Finished gathering signatures stage 9")
// Send the state to the counterparty, and receive it back with their signature.
val fullySignedTx = subFlow(CollectSignaturesFlow(partSignedTx, setOf(newOwnerFlow), GATHERING_SIGS.childProgressTracker()))
// Stage 10.
progressTracker.currentStep = FINALISING_TRANSACTION
println("Finalizing transaction")
// Notarise and record the transaction in both parties' vaults.
return subFlow(FinalityFlow(fullySignedTx, FINALISING_TRANSACTION.childProgressTracker()))
如何让PartyA签署交易?
最佳答案
经过一些试验,我发现问题出在以下方面:
您必须创建一个setOf(flowSessions),将每个参与者映射到必须传递给CollectSignaturesFlow()的其对应的initializeFlow(),其语法类似于以下内容:
val participantsParties = dealState.participants.map { serviceHub.identityService.wellKnownPartyFromAnonymous(it)!! }
val flowSessions = (participantsParties - myIdentity).map { initiateFlow(it) }.toSet()
progressTracker.currentStep = GATHERING_SIGS
println("Finished gathering signatures stage 9")
// Send the state to the counterparty, and receive it back with their signature.
val fullySignedTx = subFlow(CollectSignaturesFlow(partSignedTx, flowSessions, GATHERING_SIGS.childProgressTracker()))
关于kotlin - 如何从Corda流中的多个状态参与者那里收集签名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48174694/