无法通过CLI安装链码

时间:2017-06-15 20:50:35

标签: channel hyperledger hyperledger-fabric

我创建并加入了频道,我无法通过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.com/users/Admin@org1.example.com/msp/intermediatecerts]找不到INFO 001中间证书文件夹。跳过:[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.com/users/Admin@org1.example.com/msp/intermediatecerts]上找不到INFO 002 crls文件夹。跳过:[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 - >在[/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/config中找不到INFO 003 MSP配置文件。 yaml]:[stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/config.yaml:no such文件或目录]   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”

 
Usage:
  peer chaincode install [flags]

Global Flags:
      --cafile string              Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
  -C, --chainID string             The chain on which this command should be executed (default "testchainid")
  -c, --ctor string                Constructor message for the chaincode in JSON format (default "{}")
  -E, --escc string                The name of the endorsement system chaincode to be used for this chaincode
  -l, --lang string                Language the chaincode is written in (default "golang")
      --logging-level string       Default logging level and overrides, see core.yaml for full syntax
  -n, --name string                Name of the chaincode
  -o, --orderer string             Ordering service endpoint
  -p, --path string                Path to chaincode
  -P, --policy string              The endorsement policy associated to this chaincode
      --test.coverprofile string   Done (default "coverage.cov")
  -t, --tid string                 Name of a custom ID generation algorithm (hashing and decoding) e.g. sha256base64
      --tls                        Use TLS when communicating with the orderer endpoint
  -u, --username string            Username for chaincode operations when security is enabled
  -v, --version string             Version of the chaincode specified in install/instantiate/upgrade commands
  -V, --vscc string                The name of the verification system chaincode to be used for this chaincode

root@18599095828d:/opt/gopath/src/github.com/hyperledger/fabric/peer#

1 个答案:

答案 0 :(得分:5)

问题是您不能再使用peer容器作为CLI。您应该使用fabric-tools容器。

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

请尝试使用fabric-tools图像并且事情应该正常工作

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