我正在尝试以下情况,
从甲方到乙方有一个基本的IOU交易,其中发起方甲方将仅签署该交易,乙方仅接受该交易(不签署)。为了实现以下目标,我使用Corda样本项目的IOU流程在Corda 3中做了以下工作。
当我将其移至Corda 4时,我注意到了以下内容
'net.corda.core.transactions.SignedTransaction $ SignaturesMissingException:Missing 交易'
上的签名
如果有任何解决方法,请告诉我。
P.S:我正在使用cordapp示例Java代码
答案 0 :(得分:0)
这是实现相同功能的样品流
@InitiatingFlow
@StartableByRPC
class IssuerRegistration(
val issuerData: IssuerData
) : BaseFlow<String>() {
override val progressTracker = ProgressTracker()
@Suspendable
override fun call(): String {
// We retrieve the notary identity from the network map.
val notary = firstNotary
// We create the transaction components.
val meta_Info = Meta_Info("pdf", Utils.getCurrentDateTime(), Utils.getCurrentDateTime())
val ids = Ids(issuerData.ids.dunsId)
//create list of all parties involved in this flow
val partList = ArrayList<Party>()
partList.add(ourIdentity)
partList.add(createParty("partyb", serviceHub))
//random unique id of the state
val userUniqueId = UUID.randomUUID()
//create output state actually this will
//save to related parties vault
val outputState = IssuerState(userUniqueId.toString(),
issuerData.company_id,
issuerData.company_name,
issuerData.company_symbol,
ids,
meta_Info,
partList)
//registration command will be verified by issuercontract
val command = Command(RegistrationCommand.IssuerRegistration(),
ourIdentity.owningKey)
// We create a transaction builder and add the components.
val txBuilder = TransactionBuilder(notary = notary)
.addOutputState(outputState, RegistrationContract.ID)
.addCommand(command)
// Verifying the transaction.
txBuilder.verify(serviceHub)
// Signing the transaction. from sender side
val signedTx = serviceHub.signInitialTransaction(txBuilder)
val listOfSession = ArrayList<FlowSession>()
//creating all other party session to get
//signature from to validate the transaction
val otherPartySession = initiateFlow(otherPartySession)
listOfSession.add(otherPartySession)
//end the flow and write the transation data to related parties vault
subFlow(FinalityFlow(signedTx, listOfSession))
return userUniqueId.toString()
}
}
// Replace Responder's definition with:
@InitiatedBy(Flows.IssuerRegistration::class)
class IssueResponder(private val otherPartySession: FlowSession) : FlowLogic<Unit>() {
@Suspendable
override fun call() {
subFlow(ReceiveFinalityFlow(otherPartySession))
}
}
答案 1 :(得分:0)
问题在接受方,因为我使用的是SignTransactionFlow,它希望所有参与者都是签名人。一旦我注释了代码并运行了ReceiveFinalityFlow,它就可以正常工作。参考:SignTransactionFlow