Corda 4-单方交易未能提交到账本 [英] Corda 4 - Single Party Transaction Failed to Commit to Ledger

查看:70
本文介绍了Corda 4-单方交易未能提交到账本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从Corda 3升级到Corda 4时,我遇到一个问题,即仅一个参与方就将一个州提交到我们节点的分类帐中。单个方可以创建州并进行公证,但是在不要求外部第三方的情况下不能提交Corda 4分类帐。

While upgrading from Corda 3 to Corda 4, I have an issue commiting a State to our node's ledger with only one Party. A single Party is able to create a state, notarize it, but CANNOT commit to the Corda 4 ledger without asking for an external third party.

Corda 4产生的错误(以下是Corda 3未产生的内容:
(1) java.lang.IllegalArgumentException:必须为事务的每个外部参与者提供一个流会话。如果您希望继续使用此不安全的API,请为您的CorDapp指定小于4的目标平台版本。

The error Corda 4 produces (which Corda 3 did not produce) is the following: (1) java.lang.IllegalArgumentException: A flow session for each external participant to the transaction must be provided. If you wish to continue using this insecure API then specify a target platform version of less than 4 for your CorDapp.

更具体的上下文:使用FinalityFlow而不使用会话会产生外部方所需的会话错误,并且无法完成。

More specific context: Using FinalityFlow without a session yields a 'session required for external parties' error and does not complete. Adding only a session (e.g. session = initiateFlow(PartyA) ) results in an error that 'local nodes should not be included.'

仅添加一个会话(例如session = initializeFlow(PartyA))会导致错误,提示不应包含本地节点。是否有解决此方案的方法?对于我们的用例而言,重要的是,一个缔约方可以创建一个州并修改州信息,而无需其他方的参与。其他用例(其中包括多方)来自此用例。

Is there a workaround regarding this solution? It's important (for our use case) that a single Party can create a State and modify the State information without the involvement of other parties. Other use cases (where multiple parties are included) stem from this use case. Any guidance is greatly appreciated.

推荐答案

我认为错误消息在这里很明显。只需更改您在发行过程中调用FinalityFlow的方式,以使其不包含针对自身的流会话,即

I think the error message is pretty spot on here. Just change the way you call FinalityFlow during your issuance such that it doesn’t contain a flow session to itself i.e.

return subFlow(new FinalityFlow(signedTransaction));

尽管您可能会收到弃用警告,但在这种情况下,请执行以下操作

Although you may get a deprecation warning, in which case, do the following

return subFlow(FinalityFlow(stx, emptyList())) 

这篇关于Corda 4-单方交易未能提交到账本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆