【问题标题】:Can not install chaincode via CLI无法通过 CLI 安装链代码
【发布时间】:2017-11-18 11:56:09
【问题描述】:

我创建并加入了频道,我无法通过 CLI 安装测试链代码。我用Alpha2的时候成功了。

我在 CLI 中收到以下错误消息:

root@18599095828d:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode install -n mycc -v 1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 2017-06-13 08:09:17.401 UTC [msp] getMspConfig -> 在 [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example 找不到 INFO 001 中间证书文件夹.com/users/Admin@org1.example.com/msp/intermediatecerts]。跳过。:[stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/intermediatecerts:没有这样的文件或目录] 2017-06-13 08:09:17.401 UTC [msp] getMspConfig -> 在 [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example 中找不到 INFO 002 crls 文件夹。 com/users/Admin@org1.example.com/msp/intermediatecerts]。跳过。:[stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/crls:没有这样的文件或目录] 2017-06-13 08:09:17.401 UTC [msp] getMspConfig -> INFO 003 MSP 配置文件未在 [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example 找到.com/users/Admin@org1.example.com/msp/config.yaml]:[stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users /Admin@org1.example.com/msp/config.yaml:没有这样的文件或目录] 2017-06-13 08:09:17.424 UTC [msp] GetLocalMSP -> DEBU 004 返回现有的本地 MSP 2017-06-13 08:09:17.424 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 获取默认签名身份 2017-06-13 08:09:17.425 UTC [golang-platform] getCodeFromFS -> DEBU 006 getCodeFromFS github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 错误:获取链码代码时出错链码:获取链码包字节时出错:获取导入时出错:go list: failed with error: "exec: not started"

用法: 对等链码安装 [标志] 全局标志: --cafile string 包含用于订购端点的 PEM 编码的可信证书的文件路径 -C, --chainID string 应该执行此命令的链(默认为“testchainid”) -c, --ctor string JSON 格式的链码的构造函数消息(默认为“{}”) -E, --escc string 要用于此链码的背书系统链码的名称 -l, --lang string 编写链码的语言(默认“golang”) --logging-level 字符串 默认日志记录级别和覆盖,请参阅 core.yaml 了解完整语法 -n, --name string 链码的名称 -o, --orderer string 排序服务端点 -p, --path string 链码的路径 -P, --policy string 与此链码关联的背书策略 --test.coverprofile 字符串完成(默认“coverage.cov”) -t, --tid string 自定义 ID 生成算法的名称(散列和解码),例如sha256base64 --tls 与 orderer 端点通信时使用 TLS -u, --username string 启用安全性时链码操作的用户名 -v, --version string install/instantiate/upgrade 命令中指定的链码版本 -V, --vscc string 用于该链码的验证系统链码的名称 root@18599095828d:/opt/gopath/src/github.com/hyperledger/fabric/peer#

【问题讨论】:

    标签: channel hyperledger hyperledger-fabric


    【解决方案1】:

    问题是您不能再将对等容器用作 CLI。您应该改用 fabric-tools 容器。

    请注意此处 e2e compose 文件的更改:https://github.com/hyperledger/fabric/blob/master/examples/e2e_cli/docker-compose-cli.yaml#L42

    请尝试使用 fabric-tools 图像,应该可以了

    仅供参考 - 错误是由于 Go 编译器未包含在 fabric-peer 映像中,现在使用 CLI 打包链代码时需要它

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-26
      • 1970-01-01
      • 2018-10-06
      • 2018-09-27
      • 2019-06-05
      • 2017-08-22
      相关资源
      最近更新 更多