【问题标题】:Party for its own identity facing error : Flow sessions were not provided for the following transaction participants当事人自己的身份面临错误:没有为以下交易参与者提供流会话
【发布时间】:2021-03-23 00:31:29
【问题描述】:

Corda 企业版从 4.5 升级到 4.6 后,遵循现有流程失败,并出现自身身份错误

    val customState = CustomState(ourIdentity)

        val txBuilder = with(TransactionBuilder(notary)) {
            addOutputState(customState)
            addCommand(Command(), ourIdentity.owningKey)
        }

        txBuilder.verify(serviceHub)

        val stx = serviceHub.signInitialTransaction(txBuilder)

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

我们正在 PARTYA 节点上执行上述流程。 CustomState 只有一个参与者,即 PARTYA。我们在 FinalityFlow 调用中遇到错误

    java.lang.IllegalArgumentException: Flow sessions were not provided for the following transaction participants: [CN=PARTYA, O=PARTYA, L=London, C=GB]
    at net.corda.node.internal.aliasing.flows.EnterpriseFinalityFlow.call(EnterpriseFinalityFlow.kt:70) ~[corda-node-4.6.jar:?]
    at net.corda.node.internal.aliasing.flows.EnterpriseFinalityFlow.call(EnterpriseFinalityFlow.kt:30) ~[corda-node-4.6.jar:?]
    at net.corda.node.services.statemachine.FlowStateMachineImpl.subFlow(FlowStateMachineImpl.kt:429) ~[corda-node-4.6.jar:?]
    at net.corda.core.flows.FlowLogic.subFlow(FlowLogic.kt:414) ~[corda-core-4.6.jar:?]
    at com.custom.CustomFlow.call(CustomFlow.kt:27) ~[?:?]
    at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:356) ~[corda-node-4.6.jar:?]
    at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:76) ~[corda-node-4.6.jar:?]
    at co.paralleluniverse.fibers.Fiber.run1(Fiber.java:1105) ~[quasar-core-0.7.13_r3.jar:0.7.13_r3]
    at co.paralleluniverse.fibers.Fiber.exec(Fiber.java:801) ~[quasar-core-0.7.13_r3.jar:0.7.13_r3]
    at co.paralleluniverse.fibers.RunnableFiberTask.doExec(RunnableFiberTask.java:102) ~[quasar-core-0.7.13_r3.jar:0.7.13_r3]
    at co.paralleluniverse.fibers.RunnableFiberTask.run(RunnableFiberTask.java:93) ~[quasar-core-0.7.13_r3.jar:0.7.13_r3]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_272]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_272]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.46.Final.jar:4.1.46.Final]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_272]

build.gradle deployNodes 任务 PARTYA 节点详情

node {
        name "CN=PARTYA,O=PARTYA,L=London,C=GB"
        p2pPort 50014
        rpcSettings {
            address("localhost:50015")
            adminAddress("localhost:50055")
        }
        cordapps = []
        extraConfig = ext.extraConfig + [
                'h2Settings'    : [address: "localhost:50042"]
        ]
        rpcUsers = [[user: "john", "password": "doe", "permissions": ["ALL"]]]
 }

【问题讨论】:

    标签: corda


    【解决方案1】:

    您的流程似乎没有提供流程会话?这就是您所说的异常。

    您需要收集流程会话并提供它们,而不仅仅是 signInitialTransaction。

                List<FlowSession> sessions = otherParties
                        .stream().map(el -> initiateFlow(el))
                        .collect(Collectors.toList());
    
                SignedTransaction stx = subFlow(new CollectSignaturesFlow(ptx, sessions));
    

    来源:https://github.com/corda/samples-java/blob/master/Advanced/obligation-cordapp/workflows/src/main/java/net/corda/samples/obligation/flows/IOUIssueFlow.java#L78-L82

    如果您使用的是 Corda Enterprise,您可以随时联系支持人员,我保证他们可以为您提供帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-06-10
      • 1970-01-01
      • 2016-03-15
      • 2015-03-20
      • 2020-12-28
      • 2018-07-03
      • 1970-01-01
      相关资源
      最近更新 更多