我试图实例化一个链码后得到错误:
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 create
,channel join
和chaincode install
都成功了,或者至少在日志上没有错误消息。我正在运行cli容器中的所有命令,并且链路代码存在于提到的PATH中。
有人可以告诉我究竟发生了什么吗?
您尚未正确安装docker-compose-cli.yaml中的chaincode文件夹。
在卷部分中,检查链代码的路径。
在我的例子中,chaincode文件夹位于/home/b/fabric-samples/chaincode
所以我把它像这样装载了
- /home/b/fabric-samples/chaincode:/opt/gopath/src/github.com/chaincode