在fabric-samples/fabcar中运行startFabric.sh出现错误:
fabric-ca-client binary not found..
Follow the instructions in the Fabric docs to install the Fabric Binaries:
https://hyperledger-fabric.readthedocs.io/en/latest/install.html
1、检查fabric-ca-client binary文件到底有没有,一般在 abric-samples/bin中(和peer一样的二进制文件)
2、我是真的没有,就按照上面提示的地址下载了一个,并执行下面命令将其复制到/usr/local/bin中
sudo cp fabric-ca-client /usr/local/bin/fabric-ca-client
sudo chmod +x /usr/local/bin/fabric-ca-client
重新执行startFabric.sh时又出现了新的错误:
Error: failed to normalize chaincode path: failed to determine module root: exec: "go": executable file not found in $PATH
Chaincode packaging has failed
Deploying chaincode failed
网上很多帖子说是go需要配置代理,给出如下命令
go
env
-w GO111MODULE=on
go
env
-w GOPROXY=https:
//goproxy
.cn,direct
然后出现了提示:
虽然已经装过go了,但是不知道到底是什么问题,于是根据上面的第一条命令重新安装了一遍go(就是在fabcar这个目录下),
重新执行startFabric.sh时出现下方错误:
3、很多帖子说是“go list”的问题也给出来解决方法,但是不太适用于我的错误(大家可以参考),试了很多遍才知道是代理配置的不对,用下列命令配置linux或MAC OS中go的代理(第一种配置命令也有人成功了):
export
GO111MODULE=on
export
GOPROXY=https:
//goproxy
.cn
可能这种方式直接就添加go的环境变量了吧。
4、重新执行startFabric.sh
出现下图说明运行成功