Ibm cloud IBM区块链(Hyperledger)——“;部署链码时出错";

Ibm cloud IBM区块链(Hyperledger)——“;部署链码时出错";,ibm-cloud,blockchain,hyperledger,hyperledger-fabric,Ibm Cloud,Blockchain,Hyperledger,Hyperledger Fabric,我按照说明使用IBMBlueMix仪表板上的swagger API将一些链码部署到IBMHyperLedger区块链 为了部署一些链码,我需要提交一个JSON请求,其中包含到链码存储库的路径: { "jsonrpc": "2.0", "method": "deploy", "params": { "type": 1, "chaincodeID": { "path": "https://github.com/series0ne/learn-chaincode

我按照说明使用IBMBlueMix仪表板上的swagger API将一些链码部署到IBMHyperLedger区块链

为了部署一些链码,我需要提交一个JSON请求,其中包含到链码存储库的路径:

{
  "jsonrpc": "2.0",
  "method": "deploy",
  "params": {
    "type": 1,
    "chaincodeID": {
      "path": "https://github.com/series0ne/learn-chaincode/tree/master/finished"
    },
    "ctorMsg": {
      "function": "init",
      "args": [
        "Hello, world"
      ]
    },
    "secureContext": "user_type1_0"
  },
  "id": 0
}
在尝试部署之前,我已登录用户_type1_0,但结果如下:

{
  "jsonrpc": "2.0",
  "error": {
    "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\"\npackage github.com/series0ne/learn-chaincode/tree/master/finished: cannot find package \"github.com/series0ne/learn-chaincode/tree/master/finished\" in any of:\n\t/opt/go/src/github.com/series0ne/learn-chaincode/tree/master/finished (from $GOROOT)\n\t/opt/gopath/_usercode_/424324290/src/github.com/series0ne/learn-chaincode/tree/master/finished (from $GOPATH)\n\t/opt/gopath/src/github.com/series0ne/learn-chaincode/tree/master/finished\n"
  },
  "id": 0
}
有什么想法吗


另外,目前正在Bluemix上运行Hyperledger区块链的提交级别0.6.1。

尝试剥离部署url的“树/主”部分。请注意,下面链接的示例不包括url的这一部分:


该url将被传递到对等机中的
go-get
命令中,该命令将下载链码以便对其进行编译。因此,此url必须与此命令接受的格式相匹配。

根据Dale的建议,我尝试使用Learn Chaincode示例将存储库的地址从更改为。用于此测试的区块链网络在Bluemix上运行,Hyperledger结构版本为0.6.1。通过修改路径,可以使用区块链网络接口中的API选项卡来部署链码

以下是一些需要检查的事项

  • 来自的v2.0分支应与运行Hyperledger结构版本0.6.1的区块链网络一起使用。您的个人叉子是否与来自的v2.0分支一致
  • 链码部署是否由用于注册用户\u type1\u 0的同一验证对等方发出?可以在API选项卡的顶部选择验证对等方。Learn Chaincode说明中有一条说明,指出同一验证对等方必须注册用户并部署链码

由于ACL的原因,go-get命令无法访问包的位置,或者根据IBM文档,其参数无效。请重新检查其格式

剥离“tree/master”会导致404:()是的,剥离这些部分后url在浏览器中不起作用,但根据@AndrewTharp的回答,它应该在部署请求中起作用。如果我使用v2.0分支,路径是github.com/github_ID/learn-chaincode/tree/v2.0/finished-但是,如果更改url,区块链网络将尝试从主分支获取文件。那我该怎么办?将v2.0与master合并?是否可以从私有repo部署链码?不,不能从私有存储库部署。您无法通过rest api将git凭据传递到对等方进行部署,因此它只能拉入公共存储库。如果我使用v2.0分支,则路径为-但是,如果更改url,区块链网络将尝试从主分支获取文件。那我该怎么办?将v2.0与master合并?是否可以从私有回购中部署链码?您能否解释更多。。。正确的格式是什么?看见