【问题标题】:How to install custom chaincode?如何安装自定义链码?
【发布时间】:2020-01-24 15:34:59
【问题描述】:

我想在我的超级账本结构通道上安装自定义链码。我把我的chaincode.go文件放在我的.yaml文件之外。当我运行这个命令时:

peer chaincode install -n mycc -v 1.0 -p github.com/chaincode/chaincode_example02/go/ 

我收到了这个错误:

错误:获取链码代码时出错 mycc:链码的路径没有 存在:/opt/gopath/src/github.com/chaincode/chaincode_example02/go

我不知道opt/gopath 在哪里或者如何寻址chaincode.go 文件? 请帮帮我

【问题讨论】:

    标签: hyperledger-fabric hyperledger-chaincode


    【解决方案1】:

    当您启动网络时(如果您使用的是 first-network 模板),您会打开一个容器“CLI”,您可以在 docker-compose-cli.yaml 中找到它

    此容器用于在架构的不同节点上进行操作。

    您需要像这样创建一个与您的链码路径匹配的卷

    然后,当容器'cli'上升时,你可以进入它

    docker exec -it cli bash
    

    现在您可以导航到您的路径并查看您的链码目录。

    然后执行你的命令:

    peer chaincode install -n mycc -v 1.0 -p path/define/in/your/volume/section/to/your/chaincode
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-27
      • 1970-01-01
      • 1970-01-01
      • 2018-04-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多