最近我正在研究hyperledger / fabric-peer。
我测试了对等网络的设置。
我发现使用docker hub中的这些图像来设置网络,
我不能让对等网重新连接网络。
以下是我的所作所为。
来自docker-compose.yml
版本:'2' 服务: VP1: network_mode:host image: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 =信息 - CORE_PEER_ID = vp1 - CORE_PEER_VALIDATOR_ENABLED = true - CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN = pbft 命令:peer node start
获取同行的形象。
我得到三个码头图像。
docker-compose up,启动四个对等节点
docker stop vp3
docker start vp3
我收到错误对等重新连接错误
在vp3中,[peer] FSM错误vp0:...重复的vp1 ... vp2 ... 在vp0,vp1,vp2,[peer] FSM错误vp3:...重复
更改图像,我发现三个图像有相同的错误
P.S。
使用docker pause vp3,docker取消暂停vp3,
网络仍然正常,但这没有任何意义。
这是log。
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 }
答案 0 :(得分:0)
如果您仍在使用Fabric Hyperledger进行开发,那么现在有一个1.0版本可以从您使用的旧版本重新编写。这是指向文档https://hyperledger-fabric.readthedocs.io/en/latest/的链接,教程已经完成,也是开始的好地方。