在https://hyperledger-fabric.readthedocs.io/en/latest/Setup/JAVAChaincode/的介入之后,我能够在本地部署Hyperledger Java链代码,即:
build.gradle
文件)中peer chaincode deploy -l java -p full_path_to_X -c ...
但每当我将链代码目录上传到Github,并在部署期间尝试此地址时: peer chaincode deploy -l java -p https://github.com/user/X
,我收到错误:
"Erro getting chaincode package bytes. Error cloning git repository exit status 128"
Git存储库不是问题,因为它有一个Go链代码,我可以用这种方式成功部署Go链代码。
Hyperledger中使用的Java容器映像是否存在从Git获取远程链代码的功能?
答案 0 :(得分:0)
我不知道发生了什么,但我只能将合同部署为REST:
Resquest - POST http://127.0.0.1:7050/chaincode
{ " jsonrpc":" 2.0", "方法":"部署", " params":{ "输入":4, " chaincodeID":{ "路径":" /opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/java/SimpleSample" }, " ctorMsg":{ "功能":" init", " args":[ " a"," 100"," b"," 200" ] }, " secureContext":" jim" }, " id":1 }
响应:
{" jsonrpc":" 2.0""导致" {"状态":" OK" "消息":" 0f5b1d65041bc6d500bd0f1cab50eb6154c291ef0f4596d64b6797e8ef8f7c34a179b5a2cea82253ff3d74e768512fe0481503eadcf13d18f9761bbb8133efd0"}" ID":1}