Corda启动流会话失败

时间:2018-11-01 15:58:03

标签: corda

在运行涉及计划状态和流量的流量测试时,我遇到了一个问题。 状态和流在此处定义:Unable to initiate a flow session with another node from a ScheduledFlow

测试节点的设置如下:

@Before
fun setup() {
    mockNetwork = MockNetwork(listOf("com.example.states", "com.example.contracts", "com.example.flows", "com.example.schema"))
    a= mockNetwork.createNode(MockNodeParameters(legalName = CordaX500Name("NodeA", "London", "GB")))
    b= mockNetwork.createNode(MockNodeParameters(legalName = CordaX500Name("NodeB", "London", "GB")))
    c= mockNetwork.createNode(MockNodeParameters(legalName = CordaX500Name("NodeC", "London", "GB")))

    mockNetwork.runNetwork()
}

测试无法继续进行,并停留在以下日志中:

[INFO ] 2018-08-24T07:49:19,739Z [Node thread-1] flow.[c833dc79-501e-4484-9c43-a6924b472542].initiateSession - Initiating flow session with party O=NodeB, L=London, C=GB. Session id for tracing purposes is SessionId(toLong=4256917187941908080). {}

我如何知道NodeB模拟节点是否已关闭而无法接收流会话?令人惊讶的是,该测试在大多数时间都有效。

1 个答案:

答案 0 :(得分:0)

通过将网络定义更改为mockNetwork = MockNetwork(listOf("com.example.states", "com.example.contracts", "com.example.flows", "com.example.schema"), threadPerNode=true)

,此问题已解决