在peer0.org1上的Hyperledger Fabric链码安装失败

问题描述

我正在尝试使用教程Using the Fabric test network获取最新版本(v2.2.1),并且一切正常,直到我尝试使用./network.sh deployCC集成链码为止。

我得到以下输出

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 version go1.13.8 linux/amd64

解决方法

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

,

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

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

更改设置go版本的行

go 1.14

go 1.13

这解决了我的问题。

,

尝试

@app.route("/quote",methods=["GET","POST"])
@login_required
def quote():
"""Get stock quote."""
if request.method == "GET":
    return render_template("quote.html")
    
else:
    x =lookup(request.form.get("symbol"))
    name =x["name"]
    price =x["price"]
    
    #apology message for none value CIKMIYOOOO
    if x["name"] == None:
        return apology("Stock doesn't exist",403)

看看是否有帮助。看来该国防部可能正在将文件放在一个目录中,然后在其他目录中查找它们。默认情况下,Go现在在$ Home / go目录中查找Go Projects。可能是Go在$ home / go / pkg之类的项目中销售项目,也许这不在您的计划中?

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