成功解决docker build failed: Error returned from build: 1 “go: github.com/golang/pr...connection refused

执行以下指令安装链码时报错

peer lifecycle chaincode install basic.tar.gz

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: github.com/golang/[email protected]: Get "https://proxy.golang.org/github.com/golang/protobuf/@v/v1.3.2.mod": dial tcp 172.217.24.17:443: connect: connection refused

在这里插入图片描述
解决方案,到链码所在的目录下提前下载依赖包

cd fabric-samples/asset-transfer-basic/chaincode-go

更改go代理

go env -w GOPROXY=https://goproxy.io,direct
go env -w GO111MODULE=on
go mod vendor

重新打包智能合约并安装链码

peer lifecycle chaincode package basic.tar.gz --path ../asset-transfer-basic/chaincode-go/ --lang golang --label basic_1.0
peer lifecycle chaincode install basic.tar.gz

在这里插入图片描述
成功解决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: github.com/golang/[email protected]: Get "https://proxy.golang.org/github.com/golang/protobuf/@v/v1.3.2.mod": dial tcp 172.217.24.17:443: connect: connection refused的问题。

欢迎小伙伴的讨论,若有问题请在评论区评论或私信,谢谢你。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章