“获取链码包字节出错"通过REST在Hyperledger上部署Chaincode时 [英] "Error getting chaincode package bytes" when deploying chaincode on hyperledger via REST

查看:128
本文介绍了“获取链码包字节出错"通过REST在Hyperledger上部署Chaincode时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过POST/REST在hyperledger(Bluemix服务)上部署链代码到

I'm trying to deploy chaincode on hyperledger (Bluemix service) via POST/REST to

/链码 QuerySpec

/chaincode QuerySpec

{"jsonrpc":"2.0","method":部署","params":{"type":1, "chaincodeID":{路径": " https://github.com/romeokienzler/learn-chaincode/tree/master/完成" },"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/master/finished" }, "ctorMsg": { "function": "init", "args": [ "hi there" ] }, "secureContext": "user_type1_0" }, "id": 1 }

我也尝试过这些链接

https://github.com/romeokienzler/Learn-chaincode/blob/master/finished/chaincode_finished?raw = true

https://raw.githubusercontent.com/romeokienzler/Learn-chaincode/master/finished/chaincode_finished.go

我总是得到

{"jsonrpc":"2.0","error":{ 代码":-32001, "message":部署失败", 数据":部署链码时出错:获取链码程序包字节时出错:获取代码'go get'时出错,并出现错误:'exit 状态1'\ npackage 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/用户代码/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}

{ "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/romeokienzler/learn-chaincode/tree/master/finished: cannot find package 'github.com/romeokienzler/learn-chaincode/tree/master/finished' in any of:\n\t/usr/local/go/src/github.com/romeokienzler/learn-chaincode/tree/master/finished (from $GOROOT)\n\t/go/usercode/552962906/src/github.com/romeokienzler/learn-chaincode/tree/master/finished (from $GOPATH)\n\t/go/src/github.com/romeokienzler/learn-chaincode/tree/master/finished\n" }, "id": 1 }

有什么主意吗?

推荐答案

考虑到您正在使用Bluemix服务,我假设您正在关注

Considering that you are playing with Bluemix service, I assume you are following "Implementing your first chain code tutorial"

如果您的分叉存储库中,您将看到将分支v1.0用于Bluemix区块链服务的说明(

If your forked repository you will see instructions to use branch v1.0 for Bluemix Blockchain Services (link) IBM BMX Service is (still) using Fabric v0.5.

注册了一个可用的注册ID后,您应该可以使用 DeploySpec 部署链码(注意路径:"https://github.com/romeokienzler/learn-chaincode/tree/v1.0/finished")

Once you have Registered with one of the available Enroll ID you should be able to deploy your chaincode using DeploySpec (note the path: "https://github.com/romeokienzler/learn-chaincode/tree/v1.0/finished")

{
"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
}

这篇关于“获取链码包字节出错"通过REST在Hyperledger上部署Chaincode时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆