Fabric2.0 单机多节点环境(fabric-samples/first-network)搭建问题汇总(持续更新)

问题1:git clone项目的时候超时

解决方法:使用国内镜像,github.com.cnpmjs.org

 

问题2: failed to create deliver client for orderer

Error: failed to create deliver client for orderer: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: context deadline exceeded
!!!!!!!!!!!!!!! Fetching config block from orderer has Failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========

解决方法:

依次执行以下步骤:

// 慎用,该命令删除所有的container,删除部分fabric相关即可
$ docker rm -f $(docker ps -aq) && docker rmi -f $(docker images | grep dev | awk '{print $3}') && docker volume prune
// 关闭fabric网络
$ ./byfn.sh down
// 重新生成配置文件
$ ./byfn.sh generate
// 启动网络
$ ./byfn.sh up

 

问题3:error getting chaincode bytes,安装链码失败

===================== Anchor peers updated for org 'Org2MSP' on channel 'mychannel' ===================== 

+ peer lifecycle chaincode package mycc.tar.gz --path github.com/hyperledger/fabric-samples/chaincode/abstore/go/ --lang golang --label mycc_1
+ res=1
+ set +x
Error: error getting chaincode bytes: failed to calculate dependencies: incomplete package: github.com/hyperledger/fabric-chaincode-go/shim
!!!!!!!!!!!!!!! Chaincode packaging on peer0.org1 has failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========

解决方法:

1、首先需要确定go的版本大于1.13

2、可能是golang的环境变量问题,执行'go env',可以看到GOPROXY的值,将代理设置为如下

go env -w GOPROXY=https://goproxy.cn,direct

3、git环境问题,查看git的代理配置

git config --system --list

4、查看系统代理的问题,因为之前我设置过代理,所以在关闭的时候没有关闭干净导致了无法成功,一般没有这个问题。

// 查看代理
$ env | grep -i proxy
// 取消无效的代理
$ unset https_proxy
$ unset http_proxy
// 重启网络
$ sudo /etc/init.d/networking restart
// 查看代理
$ env | grep -i proxy

 

 

你可能感兴趣的:(区块链,区块链,Fabric)