I am using Corda Version 4.
My CorDapp has four nodes - Notary node (validating), "Node A", "Node B" and "Node C". Following are the flows defined in the app -
Flow 1: "Node A" signs and sends a trade request to "Node B". "Node C" is also notified.
Following is my code for flow 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)
Flow 2: "Node B" approves the trade request, self-signs it, gets signature from A and closes the trade. "Node C" is also notified.
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)))
I am getting following error while executing flow 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