我正在努力使用docker配置我的Corda网络(实际上与https://github.com/corda/cordapp-example
相似),我只是缺少了像this这样的真实网络的示例,加载cordapps很容易(所有到目前为止,我发现了很多示例,并且示例如下:https://github.com/corda/corda-docker/tree/master/plugins
,但是提交事务是完全不同的(我同意,这应该不难!)。
为了进行交易,需要在网络中达成共识并进行公证批准,并且如果网络中的节点未进行通信,则这两个要求都是不可能的。
当我尝试向账本提交交易时,我从Xxxxx节点获取这些日志(如您所见,交易已映射为到达localhost:10010而不是预期的xxxxxx:10010) :
[WARN ] 2018-09-20T20:47:03,246Z [main] utilities.AppendOnlyPersistentMapBase.set - Double insert in net.corda.node.utilities.AppendOnlyPersistentMap for entity class class net.corda.node.services.identity.PersistentIdentityService$PersistentIdentity key E66540FF121D732F4417B293203D1C61F9F5A467A19AC21EE0327665BA0CA561, not inserting the second time {}
[INFO ] 2018-09-20T20:47:03,257Z [main] messaging.P2PMessagingClient.updateBridgesOnNetworkChange - Updating bridges on network map change: NodeInfo(addresses=[xxxxx:10002], legalIdentitiesAndCerts=[O=Xxxxx, L=New York, C=US], platformVersion=3, serial=1537476408266) {}
[INFO ] 2018-09-20T20:47:03,465Z [main] BasicInfo.printBasicNodeInfo - Loaded CorDapps : example-cordapp-0.1, corda-finance-3.2-corda, corda-core-3.2-corda {}
[INFO ] 2018-09-20T20:47:03,481Z [main] BasicInfo.printBasicNodeInfo - Node for "Xxxxx" started up and registered in 55.5 sec {}
[INFO ] 2018-09-20T20:47:03,486Z [main] messaging.RPCServer.start - Starting RPC server with configuration RPCServerConfiguration(rpcThreadPoolSize=4, reapInterval=PT1S, deduplicationCacheExpiry=PT24H) {}
[INFO ] 2018-09-20T20:47:04,278Z [Thread-0 (ActiveMQ-client-global-threads)] messaging.RPCServer.clientArtemisMessageHandler - SUBMITTING {actor_id=user1, actor_owningIdentity=O=Xxxxx, L=New York, C=US, actor_store_id=NODE_CONFIG, invocation_id=df81b170-c57d-4d2c-ac5e-c50b2dbc951d, invocation_timestamp=2018-09-20T20:47:04.249Z, session_id=84058489-40f2-4b91-9527-8e0cfe188294, session_timestamp=2018-09-20T20:46:55.554Z}
[INFO ] 2018-09-20T20:47:07,901Z [Thread-0 (ActiveMQ-client-global-threads)] messaging.RPCServer.clientArtemisMessageHandler - SUBMITTING {actor_id=user1, actor_owningIdentity=O=Xxxxx, L=New York, C=US, actor_store_id=NODE_CONFIG, invocation_id=abaaafe5-91a9-450f-9b04-078c4446697d, invocation_timestamp=2018-09-20T20:47:07.901Z, session_id=84058489-40f2-4b91-9527-8e0cfe188294, session_timestamp=2018-09-20T20:46:55.554Z}
[INFO ] 2018-09-20T20:47:08,572Z [RxIoScheduler-2] network.PersistentNetworkMapCache.addNode - Adding node with info: NodeInfo(addresses=[localhost:10010], legalIdentitiesAndCerts=[O=Xxxxxx, L=New York, C=US], platformVersion=3, serial=1537381493186) {}
[INFO ] 2018-09-20T20:47:08,660Z [RxIoScheduler-2] network.PersistentNetworkMapCache.addNode - No previous node found {}
[INFO ] 2018-09-20T20:47:08,938Z [RxIoScheduler-2] messaging.P2PMessagingClient.updateBridgesOnNetworkChange - Updating bridges on network map change: NodeInfo(addresses=[localhost:10010], legalIdentitiesAndCerts=[O=Xxxxxx, L=New York, C=US], platformVersion=3, serial=1537381493186) {}
[INFO ] 2018-09-20T20:47:09,053Z [RxIoScheduler-2] network.PersistentNetworkMapCache.addNode - Done adding node with info: NodeInfo(addresses=[localhost:10010], legalIdentitiesAndCerts=[O=Xxxxxx, L=New York, C=US], platformVersion=3, serial=1537381493186) {}
[INFO ] 2018-09-20T20:47:09,053Z [RxIoScheduler-2] network.PersistentNetworkMapCache.addNode - Adding node with info: NodeInfo(addresses=[localhost:10013], legalIdentitiesAndCerts=[O=Xxxxxxx, L=New York, C=US], platformVersion=3, serial=1537381494853) {}
[INFO ] 2018-09-20T20:47:09,056Z [RxIoScheduler-2] network.PersistentNetworkMapCache.addNode - No previous node found {}
[INFO ] 2018-09-20T20:47:09,138Z [RxIoScheduler-2] messaging.P2PMessagingClient.updateBridgesOnNetworkChange - Updating bridges on network map change: NodeInfo(addresses=[localhost:10013], legalIdentitiesAndCerts=[O=Xxxxxxx, L=New York, C=US], platformVersion=3, serial=1537381494853) {}
[INFO ] 2018-09-20T20:47:09,161Z [RxIoScheduler-2] network.PersistentNetworkMapCache.addNode - Done adding node with info: NodeInfo(addresses=[localhost:10013], legalIdentitiesAndCerts=[O=Xxxxxxx, L=New York, C=US], platformVersion=3, serial=1537381494853) {}
[INFO ] 2018-09-20T20:47:09,161Z [RxIoScheduler-2] network.PersistentNetworkMapCache.addNode - Adding node with info: NodeInfo(addresses=[localhost:10007], legalIdentitiesAndCerts=[O=Xxxxx, L=New York, C=US], platformVersion=3, serial=1537381494948) {}
[INFO ] 2018-09-20T20:47:09,237Z [RxIoScheduler-2] network.PersistentNetworkMapCache.addNode - Discarding older nodeInfo for O=Xxxxx, L=New York, C=US {}
[INFO ] 2018-09-20T20:47:09,237Z [RxIoScheduler-2] network.PersistentNetworkMapCache.addNode - Adding node with info: NodeInfo(addresses=[localhost:10006], legalIdentitiesAndCerts=[O=Notary, L=New York, C=US], platformVersion=3, serial=1537381495396) {}
[INFO ] 2018-09-20T20:47:09,263Z [RxIoScheduler-2] network.PersistentNetworkMapCache.addNode - No previous node found {}
[INFO ] 2018-09-20T20:47:09,347Z [RxIoScheduler-2] messaging.P2PMessagingClient.updateBridgesOnNetworkChange - Updating bridges on network map change: NodeInfo(addresses=[localhost:10006], legalIdentitiesAndCerts=[O=Notary, L=New York, C=US], platformVersion=3, serial=1537381495396) {}
[INFO ] 2018-09-20T20:47:09,358Z [RxIoScheduler-2] network.PersistentNetworkMapCache.addNode - Done adding node with info: NodeInfo(addresses=[localhost:10006], legalIdentitiesAndCerts=[O=Notary, L=New York, C=US], platformVersion=3, serial=1537381495396) {}
[INFO ] 2018-09-20T20:55:56,465Z [Thread-1 (ActiveMQ-client-global-threads)] messaging.RPCServer.clientArtemisMessageHandler - SUBMITTING {actor_id=user1, actor_owningIdentity=O=Xxxxx, L=New York, C=US, actor_store_id=NODE_CONFIG, invocation_id=bb90b749-06e8-4f8d-9ef1-b841d0e7be8e, invocation_timestamp=2018-09-20T20:55:56.465Z, session_id=84058489-40f2-4b91-9527-8e0cfe188294, session_timestamp=2018-09-20T20:46:55.554Z}
[INFO ] 2018-09-20T20:55:56,529Z [Thread-1 (ActiveMQ-client-global-threads)] messaging.RPCServer.clientArtemisMessageHandler - SUBMITTING {actor_id=user1, actor_owningIdentity=O=Xxxxx, L=New York, C=US, actor_store_id=NODE_CONFIG, invocation_id=3b9a0d1b-309f-4a08-bd6d-2e332ac7e069, invocation_timestamp=2018-09-20T20:55:56.529Z, session_id=84058489-40f2-4b91-9527-8e0cfe188294, session_timestamp=2018-09-20T20:46:55.554Z}
[INFO ] 2018-09-20T20:55:57,251Z [Node thread-1] flow.[8429c030-3a58-4c1a-985c-64eca7f4c54e].initiateSession - Initiating flow session with party O=Xxxxxx, L=New York, C=US. Session id for tracing purposes is SessionId(toLong=8801945676362020052). {}
[INFO ] 2018-09-20T20:55:57,371Z [Messaging DLGWNKZHEid91BXSUY1sSxtGkcoJRjwy3NCrXHXWzsxcNU] messaging.P2PMessagingClient.createQueueIfAbsent - Create fresh queue internal.peers.DL6ZbP6hVmkL3w2rysrMYHchy7axULJssDPkjUzxvn9DB6 bound on same address {}
[INFO ] 2018-09-20T20:55:57,439Z [Thread-1 (ActiveMQ-client-global-threads)] bridging.BridgeControlListener.processControlMessage - Received bridge control message Create(nodeIdentity=DLGWNKZHEid91BXSUY1sSxtGkcoJRjwy3NCrXHXWzsxcNU, bridgeInfo=BridgeEntry(queueName=internal.peers.DL6ZbP6hVmkL3w2rysrMYHchy7axULJssDPkjUzxvn9DB6, targets=[localhost:10010], legalNames=[O=Xxxxxx, L=New York, C=US])) {actor_id=user1, actor_owningIdentity=O=Xxxxx, L=New York, C=US, actor_store_id=NODE_CONFIG, invocation_id=3b9a0d1b-309f-4a08-bd6d-2e332ac7e069, invocation_timestamp=2018-09-20T20:55:56.529Z, session_id=84058489-40f2-4b91-9527-8e0cfe188294, session_timestamp=2018-09-20T20:46:55.554Z}
[INFO ] 2018-09-20T20:55:57,462Z [Thread-1 (ActiveMQ-client-global-threads)] peers.DL6ZbP6hVmkL3w2rysrMYHchy7axULJssDPkjUzxvn9DB6 -> localhost:10010:O=Xxxxxx, L=New York, C=US.start - Create new AMQP bridge {actor_id=user1, actor_owningIdentity=O=Xxxxx, L=New York, C=US, actor_store_id=NODE_CONFIG, invocation_id=3b9a0d1b-309f-4a08-bd6d-2e332ac7e069, invocation_timestamp=2018-09-20T20:55:56.529Z, session_id=84058489-40f2-4b91-9527-8e0cfe188294, session_timestamp=2018-09-20T20:46:55.554Z}
[INFO ] 2018-09-20T20:55:57,474Z [Thread-1 (ActiveMQ-client-global-threads)] netty.AMQPClient.start - connect to: localhost:10010 {actor_id=user1, actor_owningIdentity=O=Xxxxx, L=New York, C=US, actor_store_id=NODE_CONFIG, invocation_id=3b9a0d1b-309f-4a08-bd6d-2e332ac7e069, invocation_timestamp=2018-09-20T20:55:56.529Z, session_id=84058489-40f2-4b91-9527-8e0cfe188294, session_timestamp=2018-09-20T20:46:55.554Z}
[INFO ] 2018-09-20T20:55:57,569Z [nioEventLoopGroup-2-1] netty.AMQPClient.operationComplete - Failed to connect to localhost:10010 {}
[INFO ] 2018-09-20T20:55:58,571Z [nioEventLoopGroup-2-2] netty.AMQPClient.run - Retry connect to localhost:10010 {}
[INFO ] 2018-09-20T20:55:58,574Z [nioEventLoopGroup-2-3] netty.AMQPClient.operationComplete - Failed to connect to localhost:10010 {}
[INFO ] 2018-09-20T20:55:59,576Z [nioEventLoopGroup-2-4] netty.AMQPClient.run - Retry connect to localhost:10010 {}
[INFO ] 2018-09-20T20:55:59,580Z [nioEventLoopGroup-2-5] netty.AMQPClient.operationComplete - Failed to connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:00,582Z [nioEventLoopGroup-2-6] netty.AMQPClient.run - Retry connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:00,589Z [nioEventLoopGroup-2-7] netty.AMQPClient.operationComplete - Failed to connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:01,591Z [nioEventLoopGroup-2-8] netty.AMQPClient.run - Retry connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:01,593Z [nioEventLoopGroup-2-1] netty.AMQPClient.operationComplete - Failed to connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:02,595Z [nioEventLoopGroup-2-2] netty.AMQPClient.run - Retry connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:02,599Z [nioEventLoopGroup-2-3] netty.AMQPClient.operationComplete - Failed to connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:03,600Z [nioEventLoopGroup-2-4] netty.AMQPClient.run - Retry connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:03,603Z [nioEventLoopGroup-2-5] netty.AMQPClient.operationComplete - Failed to connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:04,604Z [nioEventLoopGroup-2-6] netty.AMQPClient.run - Retry connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:04,606Z [nioEventLoopGroup-2-7] netty.AMQPClient.operationComplete - Failed to connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:05,607Z [nioEventLoopGroup-2-8] netty.AMQPClient.run - Retry connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:05,610Z [nioEventLoopGroup-2-1] netty.AMQPClient.operationComplete - Failed to connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:06,612Z [nioEventLoopGroup-2-2] netty.AMQPClient.run - Retry connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:06,614Z [nioEventLoopGroup-2-3] netty.AMQPClient.operationComplete - Failed to connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:07,616Z [nioEventLoopGroup-2-4] netty.AMQPClient.run - Retry connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:07,618Z [nioEventLoopGroup-2-5] netty.AMQPClient.operationComplete - Failed to connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:08,620Z [nioEventLoopGroup-2-6] netty.AMQPClient.run - Retry connect to localhost:10010 {}
[INFO ] 2018-09-20T20:56:08,623Z [nioEventLoopGroup-2-7] netty.AMQPClient.operationComplete - Failed to connect to localhost:10010 {}
这是与我的一个节点相关的node.conf文件(所有其他节点的格式相同):
myLegalName="O=Xxxxx,L=New York,C=US"
basedir : "/opt/corda"
p2pAddress : "xxxxx:10002"
webAddress : "xxxxx:10004"
rpcSettings {
useSsl=false
address="xxxxx:10003"
adminAddress="xxxxx:10051"
}
keyStorePassword : "cordacadevpass"
trustStorePassword : "trustpass"
h2port : 11000
useHTTPS : false
devMode : true
rpcUsers=[
{
password=test
permissions=[
ALL
]
user=user1
}
]
这是公证的node.conf文件:
basedir : "/opt/corda"
p2pAddress : "notary:10002"
webAddress : "notary:10004"
h2port : 11000
myLegalName="O=Notary,L=New York,C=US"
detectPublicIp=false
keyStorePassword : "cordacadevpass"
trustStorePassword : "trustpass"
extraAdvertisedServiceIds: [ "corda.notary.simple" ]
useHTTPS : false
devMode : true
rpcSettings = {
useSsl=false
address="notary:10003"
adminAddress="notary:10052"
}
notary {
validating=false
}
rpcUsers=[
{
password=test
permissions=[
ALL
]
user=user1
}
]
这是docker-compose.yml文件:
version: '3.3'
services:
Notary:
networks:
- corda
build:
context: .
args:
BUILDTIME_CORDA_VERSION: 3.2-corda
env_file:
- ./corda_docker.env
ports:
- "10002:10002"
image: corda/notary:2.0
container_name: notary
volumes:
- ./java-source/build/nodes/Notary/node.conf:/opt/corda/node.conf
- ./java-source/build/nodes/Notary/network-parameters:/opt/corda/network-parameters
- ./java-source/build/nodes/Notary/additional-node-infos:/opt/corda/additional-node-infos
- ./java-source/build/nodes/Notary/certificates/:/opt/corda/certificates/
- ./java-source/build/nodes/Notary/cordapps/:/opt/corda/cordapps/
Xxxxx:
networks:
- corda
build:
context: .
args:
BUILDTIME_CORDA_VERSION: 3.2-corda
env_file:
- ./corda_docker.env
ports:
- "10007:10002"
- "10008:10003"
- "10009:10004"
- "10048:10048"
image: corda/xxxxx:2.0
container_name: xxxxx
volumes:
- ./java-source/build/nodes/Xxxxx/node.conf:/opt/corda/node.conf
- ./java-source/build/nodes/Xxxxx/network-parameters:/opt/corda/network-parameters
- ./java-source/build/nodes/Xxxxx/additional-node-infos:/opt/corda/additional-node-infos
- ./java-source/build/nodes/Xxxxx/certificates/:/opt/corda/certificates/
- ./java-source/build/nodes/Xxxxx/cordapps/:/opt/corda/cordapps/
Xxxxxx:
networks:
- corda
build:
context: .
args:
BUILDTIME_CORDA_VERSION: 3.2-corda
env_file:
- ./corda_docker.env
ports:
- "10010:10002"
- "10011:10003"
- "10051:10051"
- "8888:10004"
image: corda/xxxxxx:2.0
container_name: xxxxxx
volumes:
- ./java-source/build/nodes/Xxxxxx/node.conf:/opt/corda/node.conf
- ./java-source/build/nodes/Xxxxxx/network-parameters:/opt/corda/network-parameters
- ./java-source/build/nodes/Xxxxxx/additional-node-infos:/opt/corda/additional-node-infos
- ./java-source/build/nodes/Xxxxxx/certificates/:/opt/corda/certificates/
- ./java-source/build/nodes/Xxxxxx/cordapps/:/opt/corda/cordapps/
Xxxxxxx:
networks:
- corda
build:
context: .
args:
BUILDTIME_CORDA_VERSION: 3.2-corda
env_file:
- ./corda_docker.env
ports:
- "10013:10002"
- "10014:10003"
- "10015:10004"
- "10054:10054"
image: corda/xxxxxxx:2.0
container_name: xxxxxxx
volumes:
- ./java-source/build/nodes/Xxxxxxx/node.conf:/opt/corda/node.conf
- ./java-source/build/nodes/Xxxxxxx/network-parameters:/opt/corda/network-parameters
- ./java-source/build/nodes/Xxxxxxx/additional-node-infos:/opt/corda/additional-node-infos
- ./java-source/build/nodes/Xxxxxxx/certificates/:/opt/corda/certificates/
- ./java-source/build/nodes/Xxxxxxx/cordapps/:/opt/corda/cordapps/
networks:
corda:
我应该做哪些更改才能正确映射节点?如您所见,该节点正在调用自身而不是在调用另一个对等方。
此交易涉及两个同行。
答案 0 :(得分:0)
您似乎尝试通过插件net.corda.plugins.Cordform创建节点。
但是对于Docker的节点,您应该使用net.corda.plugins.Dockerform。