为什么./network.sh createChannel总是给通道创建失败和创建通道失败的错误?

时间:2020-09-26 10:49:42

标签: hyperledger-fabric hyperledger

我遵循了官方Fabric测试网络教程“使用Fabric测试网络”,但是在运行./network.sh createChannel时报告了一些错误。日志和此类错误

+ peer channel create -o localhost:7050 -c mychannel --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/mychannel.tx --outputBlock ./channel-artifacts/mychannel.block --tls --cafile /home/centos/go/src/github.com/hyperledger/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=1
Error: failed to create deliver client for orderer: orderer client failed to connect to localhost:7050: failed to create new connection: context deadline exceeded
Channel creation failed
Create channel failed

3 个答案:

答案 0 :(得分:0)

如果您是初次使用,可以尝试以下操作以给定频道名称建立网络

./network.sh down
./network.sh up createChannel -c mychannel

答案 1 :(得分:0)

这种情况是由于TLS证书引起的。

例如,可能由于“客户端TLS /服务器无TLS”而发生。因此,请选中“ --tls $ CORE_PEER_TLS_ENABLED”选项。 “ $ CORE_PEER_TLS_ENABLED”应为真。

因此您可以在控制台中看到类似的内容:

+ peer channel create -o localhost:7050 -c mychannel --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/mychannel.tx --outputBlock ./channel-artifacts/mychannel.block  --tls true --cafile /home/centos/go/src/github.com/hyperledger/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

答案 2 :(得分:0)

我使用了这个脚本。它有效

./network.sh up createChannel -ca -c mychannel -s couchdb -i 2.2.0