在Hyperledger Fabric上启动链码时出现错误。

huangapple go评论87阅读模式
英文:

Error to start a chaincode on hyperledger fabric

问题

我正在按照Hyperledger Fabric的步骤使用Fabric测试网络,但每次尝试启动链码时都会出现以下错误信息:

错误:无法在'basic.tar.gz'中读取链码包:打开basic.tar.gz:没有该文件或目录
+ PACKAGE_ID=
错误:无法规范化链码路径:'go list'失败,错误信息如下:go: inconsistent vendoring in /home/blamazales/fabric-samples/asset-transfer-basic/chaincode-go:
        github.com/hyperledger/fabric-chaincode-go@v0.0.0-20220720122508-9207360bbddd: 在go.mod中明确要求,但在vendor/modules.txt中未标记为明确要求
        github.com/hyperledger/fabric-contract-api-go@v1.2.0: 在go.mod中明确要求,但在vendor/modules.txt中未标记为明确要求
        github.com/hyperledger/fabric-protos-go@v0.0.0-20220613214546-bf864f01d75e: 在go.mod中明确要求,但在vendor/modules.txt中未标记为明确要求
        github.com/stretchr/testify@v1.8.0: 在go.mod中明确要求,但在vendor/modules.txt中未标记为明确要求
        google.golang.org/protobuf@v1.28.0: 在go.mod中明确要求,但在vendor/modules.txt中未标记为明确要求

我已将Go更新到1.18版本,并且我正在使用Ubuntu 20.04。我还尝试将这些项目添加到modules.txt中,如要求的未标记,但仍然无法工作,除非我将其包含错误或者手动操作不可行。有什么建议吗?我正在尝试启动链码并运行Hyperledger教程中的所有示例。

英文:

I am following the steps to use the Fabric test network from the hyperledger fabric, when I try to start the chaincode always have the following message:

Error: failed to read chaincode package at 'basic.tar.gz': open basic.tar.gz: no such file or directory
+ PACKAGE_ID=
Error: failed to normalize chaincode path: 'go list' failed with: go: inconsistent vendoring in /home/blamazales/fabric-samples/asset-transfer-basic/chaincode-go:
        github.com/hyperledger/fabric-chaincode-go@v0.0.0-20220720122508-9207360bbddd: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/hyperledger/fabric-contract-api-go@v1.2.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-20220613214546-bf864f01d75e: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/stretchr/testify@v1.8.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        google.golang.org/protobuf@v1.28.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt

I updated the go to the version 1.18 and I am using Ubuntu 20.04. Also I tried to add these items on the modules.txt as mentioned to be not marked but still not working, unless I'm including it wrong or not be possible do this manually. Any ideas? And I'm trying to start the chaincode and run all the sample from hyperledger tutorial

答案1

得分: 1

我找到了。当需要更改module.txt中的这些信息时,我错过了一些需要更改的信息,例如将文件中的Go版本从1.17更改为我正在使用的1.18版本。

英文:

I found it. I miss some infos to change at module.txt when include these infos required as change the version of go that was in the file 1.17 to 1.18 which I am using

huangapple
  • 本文由 发表于 2022年12月23日 03:14:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/74892946.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定