Как настроить сеть Corda с помощью докера (используя файл YAML) - PullRequest
0 голосов
/ 21 сентября 2018

Я изо всех сил пытаюсь настроить свою сеть Corda (которая действительно похожа на https://github.com/corda/cordapp-example) с помощью докера, я просто пропускаю примеры с реальной сетью, такой как эта , загрузить cordapps легко (всепримеры, которые я нашел до сих пор, загружают и пример, как этот: https://github.com/corda/corda-docker/tree/master/plugins), но фиксация транзакции - это нечто совершенно иное (не должно быть сложно, я согласен!).

Для фиксации транзакциитребуется согласие в сети и нотариальное заверение, и если узлы в сети не обмениваются данными, оба требования невозможны.

Я получаю эти журналы от узла Ххххх, когда пытаюсь совершить переход крегистр (Как видите, транзакция сопоставлена ​​с достижением 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:

Какие изменения я должен сделать, чтобы правильно отобразить узлы?Как видите, узел вызывает сам себя вместо вызова другого узла.

В этой транзакции участвуют два партнера.

1 Ответ

0 голосов
/ 17 октября 2018

Похоже, вы пытались создать свои узлы с помощью плагина: net.corda.plugins.Cordform.

Но для узлов для Docker вы должны использовать net.corda.plugins.Dockerform.

Пример для подготовки Docker Nodes

...