BlockBench单机部署问题
- 下载Hyperdger Fabric 2.2.0的二进制文件与docker镜像
镜像下载位置:
benchmark下载到/home路径下
curl -sSL https://bit.ly/2ysbOFE | bash -s -- 2.2.0 1.4.8 -s
- Error: failed to create deliver client for orderer: orderer client failed to connect to localhost:7050: failed to create new connection: connection error: desc = “transport: error while dialing: dial tcp 127.0.0.1:7050: connect: connection refused” Channel creation failed Create channel failed(配置hyperledger fabric 2.0中)
解决方案:
#先关闭
./network.sh down
#再开启
./network.sh up
- 当前创建的容器已存在
Docker stop停止/remove删除所有容器
$ docker ps // 查看所有正在运行容器
$ docker stop containerId // containerId 是容器的ID
$ docker ps -a // 查看所有容器
$ docker ps -a -q // 查看所有容器ID
$ docker stop $(docker ps -a -q) // stop停止所有容器
$ docker rm $(docker ps -a -q) // remove删除所有容器
- 在fabric-sample中部署链码时报错,报错原因是下载依赖的连接被拒绝,如下所示:
Error: failed to normalize chaincode path: ‘go list’ failed with: go: github.com/golang/protobuf@v1.3.2: Get “https://proxy.golang.org/github.com/golang/protobuf/@v/v1.3.2.mod”: dial tcp 172.217.160.81:443: connect: connection refused: exit status 1
解决方案: 打开GO111MODULE工具,更换Go代理,命令行输入:
go env -w GOPROXY=https://goproxy.io,direct
go env -w GO111MODULE=on
- erro: chaincode install failed with status: 500,错误信息如下:
// A code block
Installing chaincode on peer0.org1...
Using organization 1
++ peer lifecycle chaincode install basic.tar.gz
++ res=1
++ set +x
Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image build failed: docker build failed: Error returned from build: 1 "go: inconsistent vendoring in /chaincode/input/src:
github.com/golang/protobuf@v1.3.2: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
github.com/hyperledger/fabric-chaincode-go@v0.0.0-20200424173110-d7076418f212: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
github.com/hyperledger/fabric-contract-api-go@v1.1.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
github.com/hyperledger/fabric-protos-go@v0.0.0-20200424173316-dd554ba3746e: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
github.com/stretchr/testify@v1.5.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
run 'go mod vendor' to sync, or use -mod=mod or -mod=readonly to ignore the vendor directory"
!!!!!!!!!!!!!!! Chaincode installation on peer0.org1 has failed !!!!!!!!!!!!!!!!
ERROR !!! Deploying chaincode failed
更新go的版本,成功了。我之前用的是go 1.13,更新后用的是1.15,问题就解决了。具体更新方式可参考这篇博客go的版本更新,go的下载链接链接