Error getting chaincode package bytes when deploying chaincode on hyperledger via REST

0 votes

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

/chaincode QuerySpec

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

I've also tried those links

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

I always get

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

Any idea?

Aug 3, 2018 in Blockchain by aryya
• 7,450 points
1,437 views

1 answer to this question.

0 votes

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

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.

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
}
answered Aug 3, 2018 by charlie_brown
• 7,720 points

Related Questions In Blockchain

0 votes
1 answer
0 votes
1 answer
+1 vote
4 answers
+1 vote
1 answer

What happened on deploy, invoke and query in Hyperledger chaincode?

1. Deploy: During Deploy the chaincode is written onto ...READ MORE

answered Apr 26, 2018 in Blockchain by Christine
• 15,790 points
1,220 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,663 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,215 views
+1 vote
1 answer

Language in which cryptokitties is programmed?

Cryptokitties is built on the Ethereum network. The ...READ MORE

answered Mar 27, 2018 in Blockchain by Johnathon
• 9,090 points
494 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP