我正在按照以下链接在Hyperledger Fabric上设置我的第一个网络 http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html
无论在此设置中提到的步骤,我几乎都可以做到。 问题是当我尝试将其他对等体加入到频道时,使用下面的指令
您可以根据需要让其他同伴加入频道 四个环境变量的适当变化。
我导出以下变量
export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
export CORE_PEER_ADDRESS=peer1.org1.example.com:8051
export CORE_PEER_LOCALMSPID="Org1MSP"
export CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt
然后我跑
peer channel join -b mychannel.block
我得到以下错误
2017-08-02 06:38:12.375 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2017-08-02 06:38:12.376 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2017-08-02 06:38:12.379 UTC [grpc] Printf -> DEBU 003 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 172.19.0.2:8051: getsockopt: connection refused"; Reconnecting to {peer1.org1.example.com:8051 <nil>}
2017-08-02 06:38:13.379 UTC [grpc] Printf -> DEBU 004 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 172.19.0.2:8051: getsockopt: connection refused"; Reconnecting to {peer1.org1.example.com:8051 <nil>}
2017-08-02 06:38:15.085 UTC [grpc] Printf -> DEBU 005 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 172.19.0.2:8051: getsockopt: connection refused"; Reconnecting to {peer1.org1.example.com:8051 <nil>}
Error: Error getting endorser client channel: PER:404 - Error trying to connect to local peer
/opt/gopath/src/github.com/hyperledger/fabric/peer/common/common.go:116 github.com/hyperledger/fabric/peer/common.GetEndorserClient
/opt/gopath/src/github.com/hyperledger/fabric/peer/channel/channel.go:149 github.com/hyperledger/fabric/peer/channel.InitCmdFactory
/opt/gopath/src/github.com/hyperledger/fabric/peer/channel/join.go:138 github.com/hyperledger/fabric/peer/channel.join
/opt/gopath/src/github.com/hyperledger/fabric/peer/channel/join.go:42 github.com/hyperledger/fabric/peer/channel.joinCmd.func1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:599 github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).execute
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:689 github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).ExecuteC
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:648 github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).Execute
/opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:118 main.main
/opt/go/src/runtime/proc.go:192 runtime.main
/opt/go/src/runtime/asm_amd64.s:2087 runtime.goexit
Caused by: context deadline exceeded
Usage:
peer channel join [flags]
Flags:
-b, --blockpath string Path to file containing genesis block
org1 peer0我能够连接但不能连接其他节点
Docker ps输出
答案 0 :(得分:5)
我想也许是端口的问题。
你设置
export CORE_PEER_ADDRESS=peer1.org1.example.com:8051
当同伴收听7051时,您需要将CORE_PEER_ADDRESS更改为
export CORE_PEER_ADDRESS=peer1.org1.example.com:7051
。
答案 1 :(得分:0)
这是端口问题。
现在如何确定要指定的端口。
检查您的configtx.yaml文件。
AnchorPeers:
- Host: peer0.org2.example.com
Port: 9052
我们需要在下面通过相同的端口。
CORE_PEER_ADDRESS=peer0.org2.example.com:9052
现在运行peer channel join -b mychannel.block
如果仍然有任何问题,您可以通过ActAchieveRepeat@gmail.com寄给我。 谢谢