首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在peer0.org 1上安装Hyperledger Fabric链码失败

在peer0.org 1上安装Hyperledger Fabric链码失败
EN

Stack Overflow用户
提问于 2020-10-12 10:07:53
回答 3查看 6.5K关注 0票数 3

我试图遵循最新版本的教程 (v2.2.1),一切都很好,直到我尝试用./network.sh deployCC输入所有的链码。

我得到以下输出:

代码语言:javascript
复制
deploying chaincode on channel 'mychannel'
executing with the following
- CHANNEL_NAME: mychannel
- CC_NAME: basic
- CC_SRC_PATH: NA
- CC_SRC_LANGUAGE: go
- CC_VERSION: 1.0
- CC_SEQUENCE: 1
- CC_END_POLICY: NA
- CC_COLL_CONFIG: NA
- CC_INIT_FCN: NA
- DELAY: 3
- MAX_RETRY: 5
- VERBOSE: false
Determining the path to the chaincode
asset-transfer-basic
Vendoring Go dependencies at ../asset-transfer-basic/chaincode-go/
~/fabric-samples/asset-transfer-basic/chaincode-go ~/fabric-samples/test-network
~/fabric-samples/test-network
Finished vendoring Go dependencies
Using organization 1
+ peer lifecycle chaincode package basic.tar.gz --path ../asset-transfer-basic/chaincode-go/ --lang golang --label basic_1.0
+ res=0
Chaincode is packaged on peer0.org1
Installing chaincode on peer0.org1...
Using organization 1
+ peer lifecycle chaincode install basic.tar.gz
+ res=1
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
Deploying chaincode failed

如果我尝试建议的go mod vendor,我会得到go: no dependencies to vendor作为答案。

其他信息:

VM:Oracle VM VirtualBox

主机:Windows 10

Linux版本:Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal

Go版本:go version go1.13.8 linux/amd64

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2020-10-19 13:41:16

请在以下文件中检查并更改go版本:

../fabric-samples/asset-transfer-basic/chaincode-go/go.mod

更改设置go版本的行。

代码语言:javascript
复制
go 1.14

代码语言:javascript
复制
go 1.13

这解决了我案子中的问题。

票数 14
EN

Stack Overflow用户

发布于 2020-10-13 09:32:34

尝试在您的对等配置中添加GODEBUG:"netdns=go“

票数 0
EN

Stack Overflow用户

发布于 2020-10-22 03:46:10

试一试

代码语言:javascript
复制
go mod tidy
go mod vendor

看看这是否有帮助。看起来,国防部可能会将文件放在一个目录中,并在其他地方寻找它们。默认情况下,Go现在在$Home/go目录中查找Go项目。可能是Go是在$home/go/pkg之类的项目中进行的,这可能不在您的道路上吗?

也许也想看看https://golang.org/doc/gopath_code.html#GOPATH

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64315723

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档