Ibm cloud &引用;获取链码包字节时出错";通过REST在hyperledger上部署链码时
我正试图通过POST/REST将链码部署到hyperledger(Bluemix服务)上 /链码 QuerySpec {“jsonrpc”:“2.0”,“方法”:“部署”,“参数”:{“类型”:1, “chaincodeID”:{“路径”: "" },“ctorMsg”:{“function”:“init”,“args”:[“hi there”]}, “secureContext”:“用户类型1\u 0”},“id”:1} 我也尝试过这些链接 我总是很紧张 {“jsonrpc”:“2.0”,“错误”:{ “代码”:-32001, “消息”:“部署失败”, “数据”:“部署链码时出错:获取链码包字节时出错:获取代码“go get”时出错,错误为:“exit” 状态1'\n包 github.com/romeokienzler/learn-chaincode/tree/master/finished:无法 查找包 “github.com/romeokienzler/learn chaincode/tree/master/finished”在任何 共:\n\t/usr/local/go/src/github.com/romeokienzler/learn-chaincode/tree/master/finished (来自 $GOROOT)\n\t/go/usercode/552962906/src/github.com/romeokienzler/learn-chaincode/tree/master/finished (来自 $GOPATH)\n\t/go/src/github.com/romeokienzler/learn chaincode/tree/master/finished\n“ },“id”:1}Ibm cloud &引用;获取链码包字节时出错";通过REST在hyperledger上部署链码时,ibm-cloud,blockchain,hyperledger,hyperledger-fabric,Ibm Cloud,Blockchain,Hyperledger,Hyperledger Fabric,我正试图通过POST/REST将链码部署到hyperledger(Bluemix服务)上 /链码 QuerySpec {“jsonrpc”:“2.0”,“方法”:“部署”,“参数”:{“类型”:1, “chaincodeID”:{“路径”: "" },“ctorMsg”:{“function”:“init”,“args”:[“hi there”]}, “secureContext”:“用户类型1\u 0”},“id”:1} 我也尝试过这些链接 我总是很紧张 {“jsonrpc”:“2.0”,
有什么想法吗?首先,部署命令应更改为(path变量的值已更改): p.S.正如@Mil4n正确提到的那样,IBMBlueMix仍然适用于Fabric v0.5。此版本应采用链码
romeokienzler/学习链码/finished
例如,
shim.ChaincodeStubInterface
尚未提供,应替换为*shim.ChaincodeStub
考虑到您正在使用Bluemix服务,我假设您正在使用
如果您的分叉存储库中有分支1.0,您将看到使用分支1.0进行Bluemix区块链服务的说明()IBM BMX服务(仍然)使用Fabric v0.5
使用一个可用的注册ID注册后,您应该能够使用DeploySpec部署链码(注意路径:“https://github.com/romeokienzler/learn-chaincode/tree/v1.0/finished
”)
他使用的是IBM BMX服务,该服务使用的是他存储库中的链码,为什么这个问题的路径在本地存在很重要?@Mil4n很好。我的答案是针对当地环境,而不是Bluemix。现在更新了。非常感谢。我在尝试部署v1.0和v2.0时遇到了这个问题。你最终解决了这个问题吗?
{
"jsonrpc": "2.0",
"method": "deploy",
"params": {
"type": 1,
"chaincodeID": {
"path": "https://github.com/romeokienzler/learn-chaincode/finished"
},
"ctorMsg": {
"function": "init",
"args": ["hi there"]
},
"secureContext": "user_type1_0"
},
"id": 1
}
{
"jsonrpc": "2.0",
"method": "deploy",
"params": {
"type": 1,
"chaincodeID": {
"path": "https://github.com/romeokienzler/learn-chaincode/tree/v1.0/finished"
},
"ctorMsg": {
"function": "init",
"args": [
"hi there"
]
},
"secureContext": "user_type1_0"
},
"id": 1
}