无法运行结构第一网络示例
这是我运行时的日志:./byfn up
/ ___| |_ _| / \ | _ \ |_ _|
\___ \ | | / _ \ | |_) | | |
___) | | | / ___ \ | _ < | |
|____/ |_| /_/ \_\ |_| \_\ |_|
Build your first network (BYFN) end-to-end test
Channel name : mychannel
Creating channel...
+ peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=0
+ set +x
2019-06-27 22:22:11.117 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-06-27 22:22:12.361 UTC [cli.common] readBlock -> INFO 002 Received block: 0
===================== Channel 'mychannel' created =====================
Having all peers join the channel...
+ peer channel join -b mychannel.block
+ res=1
+ set +x
Error: error getting endorser client for channel: endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp: lookup peer0.org1.example.com: no such host"
peer0.org1 failed to join the channel, Retry after 9 seconds
我的环境:
Ubuntu 18.04
Docker version 18.06.1-ce, build e68fc7a
docker-compose version 1.24.0, build 0aa59064
go version go1.11.11 linux/amd64
echo $GOPATH results in /usr/local/go/bin
同行应该能够加入频道
答案 0 :(得分:1)
尝试在 peer-base.yaml 文件的环境部分中添加- GODEBUG=netdns=go
,该文件可在 fabric-samples / first-newtork / base /
这是一个众所周知的问题 简而言之,这是由于文件resolv.conf的更改引起的,Hyperledger Fabric中的容器间域名解析从纯Go解析器切换到cgo解析器,由已知静态链接cgo引起的SIGSEGV错误被触发,因此Hyperledger Fabric部署失败。 要了解更多信息,请遵循此link。
答案 1 :(得分:0)
这是常见问题,停止网络,删除所有以前的容器并修剪docker的卷,然后重新启动docker,最后再次重新运行网络:
$./byfn.sh down
$docker stop $(docker ps -a -q)
$docker rm $(docker ps -a -q)
$docker volume prune
$sudo systemctl daemon-reload
$sudo systemctl restart docker
$cd .....fabric-samples/first-network
$./byfn.sh -m generate
$./byfn.sh -m up
答案 2 :(得分:-1)
通过在Ubuntu 16.04 LTS中运行示例来解决此问题。 之前我曾在Ubuntu 18.04上进行过尝试,但是Hyperledger Fabric开发的目标操作系统是Ubuntu 16,而不是全新的18,因此可以在Ubuntu 16中顺利运行是很有意义的。