栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Go语言

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

Go语言 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

成功解决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/protobuf@v1.3.2: 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/protobuf@v1.3.2: Get "https://proxy.golang.org/github.com/golang/protobuf/@v/v1.3.2.mod": dial tcp 172.217.24.17:443: connect: connection refused的问题。

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

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/945202.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号