我使用Corda 3.1与自我编译版本的义务cordapp示例。该环境具有部署有方节点的弹簧引导网络地图服务以及部署到多个AWS EC2实例的公证节点。每个节点的持久性都由postgres数据库中自己的模式支持。
从内部Web服务器启动IssueObligation.kt flow(IOU)时遇到以下异常:
[INFO ] 2018-06-07T14:27:01,751Z [Node thread-1] flow.[d04d24bf-5aa7-472a-b336-2e72feff6abf].initiateSession - Initiating flow session with party O=Notary, L=Dover, C=US. Session id for tracing purposes is SessionId(toLong=7742727399076294852). {}
[WARN ] 2018-06-07T14:27:01,776Z [Node thread-1] flow.[d04d24bf-5aa7-472a-b336-2e72feff6abf].run - Terminated by unexpected exception {}
java.lang.IllegalArgumentException: Don't know about party O=Notary, L=Dover, C=US
at net.corda.node.services.statemachine.StateMachineManagerImpl.sendSessionMessage(StateMachineManagerImpl.kt:616) ~[corda-node-3.1-corda.jar:?]
at net.corda.node.services.statemachine.StateMachineManagerImpl.processSendRequest(StateMachineManagerImpl.kt:582) ~[corda-node-3.1-corda.jar:?]
at net.corda.node.services.statemachine.StateMachineManagerImpl.processIORequest(StateMachineManagerImpl.kt:569) ~[corda-node-3.1-corda.jar:?]
at net.corda.node.services.statemachine.StateMachineManagerImpl.access$processIORequest(StateMachineManagerImpl.kt:63) ~[corda-node-3.1-corda.jar:?]
at net.corda.node.services.statemachine.StateMachineManagerImpl$initFiber$2.invoke(StateMachineManagerImpl.kt:444) ~[corda-node-3.1-corda.jar:?]
at net.corda.node.services.statemachine.StateMachineManagerImpl$initFiber$2.invoke(StateMachineManagerImpl.kt:63) ~[corda-node-3.1-corda.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl$suspend$2.write(FlowStateMachineImpl.kt:507) ~[corda-node-3.1-corda.jar:?]
at co.paralleluniverse.fibers.Fiber$3.run(Fiber.java:1994) ~[quasar-core-0.7.9-jdk8.jar:0.7.9]
at co.paralleluniverse.fibers.Fiber.exec(Fiber.java:824) [quasar-core-0.7.9-jdk8.jar:0.7.9]
at co.paralleluniverse.fibers.RunnableFiberTask.doExec(RunnableFiberTask.java:100) [quasar-core-0.7.9-jdk8.jar:0.7.9]
at co.paralleluniverse.fibers.RunnableFiberTask.run(RunnableFiberTask.java:91) [quasar-core-0.7.9-jdk8.jar:0.7.9]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_171]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_171]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_171]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_171]
at net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:62) [corda-node-3.1-corda.jar:?]
流中没有任何其他异常指向此确切发生的位置,但它确实发生在方节点与另一方节点成功交互以发出IOU之后。网络地图服务知道公证人,因为它在已注册的节点列表中报告它。 派对节点知道公证人,因为我们在执行此行时没有看到流失败:
val firstNotary get() = serviceHub.networkMapCache.notaryIdentities.firstOrNull() ?: throw FlowException("No available notary.")
试着找出解决问题的步骤。
答案 0 :(得分:1)
我有一个类似的设置,这对我使用开发模式。
根本原因:网络参数文件只是dev_CA的签名文件,支持使用密钥X
签名的signedNodeInfo是有效的公证人。引发错误的原因是您的公证人在VM上的现有密钥可能是X
,但分发给其他节点的网络参数文件正在支持Y
。
因此,公证人无法向其他节点证明,他使用密钥X
是有效的公证人。
引导程序的作用:
nodeInfo-${hash}
nodeInfo-${hash}
以生成网络参数文件解决问题。
重新分发nodeInfo-${hash}
(可选)
nodeInfo-${hash}
。node_identities
表java -jar corda.jar --just-generate-node-info
以生成nodeInfo-${hash}
文件通过强制bootstrapper.jar使用公证现有密钥重新生成网络参数文件
java -jar network-bootstrapper.jar folder/
.folder/ // root folder containing the notary
├── notary_node // The notary's folder name (must be renamed this way)
├── certificates // The notary's certificates folder with the keys
└── notary_node.conf // The notary config (must be renamed this way)
答案 1 :(得分:0)
在更改“义务”示例以使其与IOU示例匹配之后,我们能够使其工作。事实证明,在事务上设置时间窗口可以与引起错误的公证人进行某种形式的通信。我不知道为什么。
.setTimeWindow(serviceHub.clock.instant(), 30.seconds)
尽管删除此行将允许将义务(iou)写到分类帐,但必须要求此行与公证人进行后续的结算命令-因为即使现金有现金,我们总是会看到资金不足错误已发出。因此,仍然没有答案。