我正在通过IBM的区块链课程3学习区块链。当我尝试部署链代码时,它会选择主代码而不是2.0版。我看到了一个相关的post,但没有帮助。
完成JSON:
{
"jsonrpc": "2.0",
"method": "deploy",
"params": {
"type": 1,
"chaincodeID": {
"path": "https://github.com/dithmarschen96/learn-chaincode.v2/start"
},
"ctorMsg": {
"function": "init",
"args": [
"hi there"
]
},
"secureContext": "user_type1_1"
},
"id": 1
}
错误消息(注意:它说无法读取用户名,但如果我删除路径中的“.v2”,则使用相同的用户名)。
"code": -32001,
"message": "Deployment failure",
"data": "Error when deploying chaincode: Error getting chaincode package bytes: Error getting code 'go get' failed with error: \"exit status 1\"\n# cd .; git clone https://github.com/dithmarschen96/learn-chaincode.v2 /opt/gopath/_usercode_/557323755/src/github.com/dithmarschen96/learn-chaincode.v2\nCloning into '/opt/gopath/_usercode_/557323755/src/github.com/dithmarschen96/learn-chaincode.v2'...\nfatal: could not read Username for 'https://github.com': No such device or address\npackage github.com/dithmarschen96/learn-chaincode.v2/start: exit status 128\n"
如果我在路径中删除“.v2”它工作正常,但我得到主人而不是分支。
如何在JSON中引用版本2以进行帖子调用?
答案 0 :(得分:0)
Found it in the doc for the course:
Tip: You can use gopkg.in to provide a URL for the chaincode deploy that uses a GitHub branch version: http://gopkg.in//learn-chaincode.v2/finished