0

最近我正在研究超级账本/fabric-peer。

我测试了对等网络的设置。

我发现使用 docker hub 中的这些图像来设置网络,

我不能让对等方重新连接网络。


以下是我所做的。

  1. 获得四台电脑。安装 ubuntu 服务器 16.04
  2. 获取 docker 1.12.2 和 docker-compose 1.9.0-rc1 。
  3. 编写 docker-compose.yml

    版本:'2' 服务:vp1:network_mode:主机图像:hyperledger/fabric-peer:x86_64-0.6.0-preview 端口:-“7050:7050”-“7051:7051”-“7052:7052”-“7053 :7053" 卷:- ./patch:/opt/gopath/src/chaincode 环境:- CORE_PEER_ADDRESSAUTODETECT=true - CORE_VM_ENDPOINT= http://localhost:2375 - CORE_PEER_ADDRESS=192.168.1.101:7051 - CORE_PEER_DISCOVERY_ROOTNODE=192.168.1.100:7051 - CORE_LOGGING_LEVEL=info - CORE_PEER_ID=vp1 - CORE_PEER_VALIDATOR_ENABLED=true - CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft 命令:对等节点启动

  4. 获取对等体的图像。

    我得到三个泊坞窗图像。

    • 超级账本/fabric-peer:x86_64-0.6.1-preview
    • 超级账本/fabric-peer:x86_64-0.6.0-preview
    • hyperledger/fabric-peer:x86_64-0.7.0-SNAPSHOT-c6e56d6 // 我通过使用 vagrant 并使 peer 不在 docker hub 中得到这个。
  5. docker-compose up,启动四个peer节点

  6. 码头工人停止 vp3

  7. 码头工人启动vp3

  8. 我收到错误,对等方重新连接错误

    在 vp3 中,[peer] FSM 错误 vp0:... 重复 vp1... vp2... 在 vp0、vp1、vp2 中,[peer] FSM 错误 vp3:... 重复

  9. 换个图,发现三张图片报错一样


所以,我的问题是,fabric-peer 现在真的完成了对等重新连接吗?

如何解决重启的peer重连?重新连接网络错误,然后网络只是与三个对等方进行 CONSENSUS 放弃第四个。


附言

使用 docker pause vp3 和 docker unpause vp3 ,

网络还可以,但这没有任何意义。

这是日志。

Attaching to composetest_vp1_1, composetest_vp0_1
[36mvp1_1  |[0m 10:52:23.477 [peer] func1 -> INFO 001[0m Auto detected peer address: 172.17.0.3:7051
[36mvp1_1  |[0m 10:52:23.478 [peer] func1 -> INFO 002[0m Auto detected peer address: 172.17.0.3:7051
[36mvp1_1  |[0m 10:52:23.480 [nodeCmd] serve -> INFO 003[0m Security enabled status: false
[36mvp1_1  |[0m 10:52:23.480 [nodeCmd] serve -> INFO 005[0m Privacy enabled status: false
[36mvp1_1  |[0m 10:52:23.480 [eventhub_producer] start -> INFO 004[0m event processor started
[36mvp1_1  |[0m 10:52:23.933 [chaincode] NewChaincodeSupport -> INFO 006[0m Chaincode support using peerAddress: 172.17.0.3:7051
[36mvp1_1  |[0m 10:52:23.934 [sysccapi] RegisterSysCC -> INFO 007[0m system chaincode (noop,github.com/hyperledger/fabric/bddtests/syschaincode/noop) disabled
[36mvp1_1  |[0m 10:52:23.934 [state] loadConfig -> INFO 008[0m Loading configurations...
[36mvp1_1  |[0m 10:52:23.934 [state] loadConfig -> INFO 009[0m Configurations loaded. stateImplName=[buckettree], stateImplConfigs=map[numBuckets:%!s(int=1000003) maxGroupingAtEachLevel:%!s(int=5) bucketCacheSize:%!s(int=100)], deltaHistorySize=[500]
[36mvp1_1  |[0m 10:52:23.934 [state] NewState -> INFO 00a[0m Initializing state implementation [buckettree]
[36mvp1_1  |[0m 10:52:23.934 [buckettree] initConfig -> INFO 00b[0m configs passed during initialization = map[string]interface {}{"maxGroupingAtEachLevel":5, "bucketCacheSize":100, "numBuckets":1000003}
[36mvp1_1  |[0m 10:52:23.934 [buckettree] initConfig -> INFO 00c[0m Initializing bucket tree state implemetation with configurations &{maxGroupingAtEachLevel:5 lowestLevel:9 levelToNumBucketsMap:map[1:3 7:40001 5:1601 3:65 4:321 6:8001 2:13 0:1 9:1000003 8:200001] hashFunc:0xab3e40}
[36mvp1_1  |[0m 10:52:23.935 [buckettree] newBucketCache -> INFO 00d[0m Constructing bucket-cache with max bucket cache size = [100] MBs
[33mvp0_1  |[0m 10:52:21.967 [peer] func1 -> INFO 001[0m Auto detected peer address: 172.17.0.2:7051
[36mvp1_1  |[0m 10:52:23.935 [buckettree] loadAllBucketNodesFromDB -> INFO 00e[0m Loaded buckets data in cache. Total buckets in DB = [0]. Total cache size:=0
[33mvp0_1  |[0m 10:52:21.968 [peer] func1 -> INFO 002[0m Auto detected peer address: 172.17.0.2:7051
[36mvp1_1  |[0m 10:52:23.935 [genesis] func1 -> INFO 00f[0m Creating genesis block.
[33mvp0_1  |[0m 10:52:21.970 [nodeCmd] serve -> INFO 003[0m Security enabled status: false
[36mvp1_1  |[0m 10:52:23.937 [consensus/controller] NewConsenter -> INFO 010[0m Creating default consensus plugin (noops)
[33mvp0_1  |[0m 10:52:21.970 [nodeCmd] serve -> INFO 004[0m Privacy enabled status: false
[36mvp1_1  |[0m 10:52:23.937 [consensus/statetransfer] blockThread -> INFO 011[0m Validated blockchain to the genesis block
[33mvp0_1  |[0m 10:52:21.970 [eventhub_producer] start -> INFO 005[0m event processor started
[36mvp1_1  |[0m 10:52:23.938 [consensus/noops] newNoops -> INFO 012[0m NOOPS consensus type = *noops.Noops
[33mvp0_1  |[0m 10:52:22.880 [chaincode] NewChaincodeSupport -> INFO 006[0m Chaincode support using peerAddress: 172.17.0.2:7051
[36mvp1_1  |[0m 10:52:23.938 [consensus/noops] newNoops -> INFO 013[0m NOOPS block size = 500
[33mvp0_1  |[0m 10:52:22.881 [sysccapi] RegisterSysCC -> INFO 007[0m system chaincode (noop,github.com/hyperledger/fabric/bddtests/syschaincode/noop) disabled
[36mvp1_1  |[0m 10:52:23.938 [consensus/noops] newNoops -> INFO 014[0m NOOPS block wait = 1s
[33mvp0_1  |[0m 10:52:22.881 [state] loadConfig -> INFO 008[0m Loading configurations...
[36mvp1_1  |[0m 10:52:23.939 [nodeCmd] serve -> INFO 015[0m Starting peer with ID=name:"vp1" , network ID=dev, address=172.17.0.3:7051, rootnodes=vp0:7051, validator=true
[33mvp0_1  |[0m 10:52:22.882 [state] loadConfig -> INFO 009[0m Configurations loaded. stateImplName=[buckettree], stateImplConfigs=map[maxGroupingAtEachLevel:%!s(int=5) bucketCacheSize:%!s(int=100) numBuckets:%!s(int=1000003)], deltaHistorySize=[500]
[36mvp1_1  |[0m 10:52:23.939 [rest] StartOpenchainRESTServer -> INFO 016[0m Initializing the REST service on 0.0.0.0:7050, TLS is disabled.
[33mvp0_1  |[0m 10:52:22.882 [state] NewState -> INFO 00a[0m Initializing state implementation [buckettree]
[36mvp1_1  |[0m 10:53:06.774 [main] main -> INFO 017[0m Exiting.....
[33mvp0_1  |[0m 10:52:22.882 [buckettree] initConfig -> INFO 00b[0m configs passed during initialization = map[string]interface {}{"bucketCacheSize":100, "numBuckets":1000003, "maxGroupingAtEachLevel":5}
[33mvp0_1  |[0m 10:52:22.882 [buckettree] initConfig -> INFO 00c[0m Initializing bucket tree state implemetation with configurations &{maxGroupingAtEachLevel:5 lowestLevel:9 levelToNumBucketsMap:map[9:1000003 3:65 2:13 5:1601 4:321 7:40001 1:3 6:8001 0:1 8:200001] hashFunc:0xab3e40}
[33mvp0_1  |[0m 10:52:22.882 [buckettree] newBucketCache -> INFO 00d[0m Constructing bucket-cache with max bucket cache size = [100] MBs
[33mvp0_1  |[0m 10:52:22.882 [buckettree] loadAllBucketNodesFromDB -> INFO 00e[0m Loaded buckets data in cache. Total buckets in DB = [0]. Total cache size:=0
[33mvp0_1  |[0m 10:52:22.882 [genesis] func1 -> INFO 00f[0m Creating genesis block.
[33mvp0_1  |[0m 10:52:22.885 [consensus/statetransfer] blockThread -> INFO 010[0m Validated blockchain to the genesis block
[33mvp0_1  |[0m 10:52:22.885 [consensus/controller] NewConsenter -> INFO 011[0m Creating default consensus plugin (noops)
[33mvp0_1  |[0m 10:52:22.886 [consensus/noops] newNoops -> INFO 012[0m NOOPS consensus type = *noops.Noops
[33mvp0_1  |[0m 10:52:22.886 [consensus/noops] newNoops -> INFO 013[0m NOOPS block size = 500
[33mvp0_1  |[0m 10:52:22.886 [consensus/noops] newNoops -> INFO 014[0m NOOPS block wait = 1s
[36mvp1_1  |[0m 
[33mvp0_1  |[0m 10:52:22.887 [nodeCmd] serve -> INFO 015[0m Starting peer with ID=name:"jdoe" , network ID=dev, address=172.17.0.2:7051, rootnodes=, validator=true
[36mvp1_1  |[0m terminated
[33mvp0_1  |[0m 10:52:22.887 [rest] StartOpenchainRESTServer -> INFO 016[0m Initializing the REST service on 0.0.0.0:7050, TLS is disabled.
[36mvp1_1  |[0m 10:53:39.474 [peer] func1 -> INFO 001[0m Auto detected peer address: 172.17.0.3:7051
[33mvp0_1  |[0m [31m10:53:06.800 [peer] handleChat -> ERRO 017[0m Error during Chat, stopping handler: stream error: code = 1 desc = "context canceled"
[36mvp1_1  |[0m 10:53:39.474 [peer] func1 -> INFO 002[0m Auto detected peer address: 172.17.0.3:7051
[33mvp0_1  |[0m [33m10:53:10.888 [peer] ensureConnected -> WARN 018[0m Touch service indicates dropped connections, attempting to reconnect...
[36mvp1_1  |[0m 10:53:39.476 [nodeCmd] serve -> INFO 003[0m Security enabled status: false
[33mvp0_1  |[0m [31m10:53:13.888 [peer] chatWithPeer -> ERRO 019[0m Error creating connection to peer address 172.17.0.3:7051: grpc: timed out when dialing
[33mvp0_1  |[0m [33m10:53:16.888 [peer] ensureConnected -> WARN 01a[0m Touch service indicates dropped connections, attempting to reconnect...
[33mvp0_1  |[0m [31m10:53:19.888 [peer] chatWithPeer -> ERRO 01b[0m Error creating connection to peer address 172.17.0.3:7051: grpc: timed out when dialing
[33mvp0_1  |[0m [33m10:53:22.888 [peer] ensureConnected -> WARN 01c[0m Touch service indicates dropped connections, attempting to reconnect...
[33mvp0_1  |[0m [31m10:53:25.888 [peer] chatWithPeer -> ERRO 01d[0m Error creating connection to peer address 172.17.0.3:7051: grpc: timed out when dialing
[33mvp0_1  |[0m [33m10:53:28.888 [peer] ensureConnected -> WARN 01e[0m Touch service indicates dropped connections, attempting to reconnect...
[33mvp0_1  |[0m [31m10:53:31.888 [peer] chatWithPeer -> ERRO 01f[0m Error creating connection to peer address 172.17.0.3:7051: grpc: timed out when dialing
[33mvp0_1  |[0m [33m10:53:34.888 [peer] ensureConnected -> WARN 020[0m Touch service indicates dropped connections, attempting to reconnect...
[33mvp0_1  |[0m [31m10:53:37.888 [peer] chatWithPeer -> ERRO 021[0m Error creating connection to peer address 172.17.0.3:7051: grpc: timed out when dialing
[33mvp0_1  |[0m [31m10:53:40.012 [peer] handleChat -> ERRO 022[0m Error handling message: Peer FSM failed while handling message (DISC_HELLO): current state: created, error: transition canceled with error: Error registering Handler: Duplicate Handler error: {name:"vp1"  172.17.0.3:7051 VALIDATOR }
[36mvp1_1  |[0m 10:53:39.476 [nodeCmd] serve -> INFO 004[0m Privacy enabled status: false
[36mvp1_1  |[0m 10:53:39.476 [eventhub_producer] start -> INFO 005[0m event processor started
[36mvp1_1  |[0m 10:53:40.003 [chaincode] NewChaincodeSupport -> INFO 006[0m Chaincode support using peerAddress: 172.17.0.3:7051
[36mvp1_1  |[0m 10:53:40.004 [sysccapi] RegisterSysCC -> INFO 007[0m system chaincode (noop,github.com/hyperledger/fabric/bddtests/syschaincode/noop) disabled
[36mvp1_1  |[0m 10:53:40.004 [state] loadConfig -> INFO 008[0m Loading configurations...
[36mvp1_1  |[0m 10:53:40.005 [state] loadConfig -> INFO 009[0m Configurations loaded. stateImplName=[buckettree], stateImplConfigs=map[bucketCacheSize:%!s(int=100) numBuckets:%!s(int=1000003) maxGroupingAtEachLevel:%!s(int=5)], deltaHistorySize=[500]
[36mvp1_1  |[0m 10:53:40.005 [state] NewState -> INFO 00a[0m Initializing state implementation [buckettree]
[36mvp1_1  |[0m 10:53:40.005 [buckettree] initConfig -> INFO 00b[0m configs passed during initialization = map[string]interface {}{"bucketCacheSize":100, "numBuckets":1000003, "maxGroupingAtEachLevel":5}
[36mvp1_1  |[0m 10:53:40.005 [buckettree] initConfig -> INFO 00c[0m Initializing bucket tree state implemetation with configurations &{maxGroupingAtEachLevel:5 lowestLevel:9 levelToNumBucketsMap:map[5:1601 4:321 8:200001 7:40001 9:1000003 2:13 1:3 0:1 6:8001 3:65] hashFunc:0xab3e40}
[36mvp1_1  |[0m 10:53:40.005 [buckettree] newBucketCache -> INFO 00d[0m Constructing bucket-cache with max bucket cache size = [100] MBs
[36mvp1_1  |[0m 10:53:40.005 [buckettree] loadAllBucketNodesFromDB -> INFO 00e[0m Loaded buckets data in cache. Total buckets in DB = [0]. Total cache size:=0
[36mvp1_1  |[0m 10:53:40.007 [consensus/controller] NewConsenter -> INFO 00f[0m Creating default consensus plugin (noops)
[36mvp1_1  |[0m 10:53:40.007 [consensus/statetransfer] blockThread -> INFO 010[0m Validated blockchain to the genesis block
[36mvp1_1  |[0m 10:53:40.008 [consensus/noops] newNoops -> INFO 011[0m NOOPS consensus type = *noops.Noops
[36mvp1_1  |[0m 10:53:40.008 [consensus/noops] newNoops -> INFO 012[0m NOOPS block size = 500
[36mvp1_1  |[0m 10:53:40.008 [consensus/noops] newNoops -> INFO 013[0m NOOPS block wait = 1s
[36mvp1_1  |[0m 10:53:40.009 [nodeCmd] serve -> INFO 014[0m Starting peer with ID=name:"vp1" , network ID=dev, address=172.17.0.3:7051, rootnodes=vp0:7051, validator=true
[36mvp1_1  |[0m 10:53:40.013 [rest] StartOpenchainRESTServer -> INFO 015[0m Initializing the REST service on 0.0.0.0:7050, TLS is disabled.
[36mvp1_1  |[0m [31m10:53:40.013 [peer] handleChat -> ERRO 016[0m Error handling message: Peer FSM failed while handling message (DISC_HELLO): current state: created, error: transition canceled with error: Error registering Handler: Duplicate Handler error: {name:"jdoe"  172.17.0.2:7051 VALIDATOR }    
4

1 回答 1

0

如果您仍在使用 Fabric Hyperledger 进行开发,那么现在有一个 1.0 版本,它是您使用的旧版本的重写。这是文档的链接https://hyperledger-fabric.readthedocs.io/en/latest/ 教程做得很好,是开始的好地方。

于 2017-08-03T20:24:41.423 回答