远程链代码安装失败

时间:2017-06-26 14:23:17

标签: install blockchain hyperledger hyperledger-fabric

我从官方docker hub下载了Fabric 1.0并运行它,成功运行本地链代码,但我想安装远程HTTP链代码,例如来自github.com

这是我在CLI中的命令:

peer chaincode install -n devincc -v 1.0 -p https://raw.githubusercontent.com/studyzy/ChainCode/master/chaincode_example02/chaincode_example02.go

或:

peer chaincode install -n devincc -v 1.0 -p https://github.com/studyzy/ChainCode

所有这些都没有用,显示日志:

  

2017-06-22 08:00:57.043 UTC [golang-platform] getCodeFromFS - > DEBU 006 getCodeFromFS https://github.com/studyzy/ChainCode/example02   错误:获取链码代码链错误:获取链码包字节时出错:获取代码不存在时出错无法打开文件打开/opt/gopath/src/https:/github.com/studyzy/ChainCode/example02:没有这样的文件或目录

是否有任何安装URL链代码的命令?

2 个答案:

答案 0 :(得分:1)

Fabric 1.0不支持远程路径(" http://"在" -p"选项值中)。包装现在都在CLI中,即客户端和开发人员应该在GOPATH中拥有代码。

答案 1 :(得分:0)

虽然@Mark P,但Hyperledger不支持安装远程链码的事实是完全正确的,例如: http,https。您仍然可以通过显式调用:

来安装远程链代码
go get https://github.com/studyzy/ChainCode

然后

peer chaincode install -n devincc -v 1.0 -p github.com/studyzy/ChainCode

您只需在GOPATH上设置链码即可。