【问题标题】:Can't load package: package chaincode/chaincode_example02无法加载包:package chaincode/chaincode_example02
【发布时间】:2023-04-02 14:43:01
【问题描述】:

在尝试实例化链码后出现以下错误:

2018-03-28 12:51:27.568 UTC [util] DockerBuild -> DEBU 3b2 Attempting build with image hyperledger/fabric-ccenv:x86_64-1.0.6
2018-03-28 12:51:28.418 UTC [chaincode-platform] func1 -> ERRO 3b3 Failed to generate platform-specific docker build: Error returned from build: 1 "can't load package: package chaincode/chaincode_example02: cannot find package "chaincode/chaincode_example02" in any of:
    /opt/go/src/chaincode/chaincode_example02 (from $GOROOT)
    /chaincode/input/src/chaincode/chaincode_example02 (from $GOPATH)
    /opt/gopath/src/chaincode/chaincode_example02

嗯,之前的操作如channel createchannel joinchaincode install都成功了,或者至少日志上没有错误信息。我正在从 cli 容器运行所有命令,并且链代码存在于提到的 PATH 中。

谁能告诉我到底发生了什么?

【问题讨论】:

  • 你解决了吗?

标签: hyperledger-fabric hyperledger


【解决方案1】:

你没有正确挂载 docker-compose-cli.yaml 中的链码文件夹。

在卷部分,查看链码的路径。

在我的例子中,chaincode 文件夹位于/home/b/fabric-samples/chaincode

所以我在卷中这样安装它

- /home/b/fabric-samples/chaincode:/opt/gopath/src/github.com/chaincode

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-11
    • 2019-10-16
    • 2017-09-24
    • 2016-11-30
    • 1970-01-01
    相关资源
    最近更新 更多