IBM-Blockchain-Archive / ibm-blockchain-issues

Having issues with the IBM Blockchain Bluemix service? Let us know!
13 stars 12 forks source link

Cannot deploy chaincode from a tutorial #99

Closed Artem-G closed 7 years ago

Artem-G commented 7 years ago

I am following this tutorial https://console.ng.bluemix.net/docs/services/blockchain/ibmblockchain_tutorials.html

I have forked and commited Go code here: https://github.com/Artem-G/learn-chaincode/tree/v2.0/start

Why I get this error when I try to deploy?

{
  "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/Artem-G/learn-chaincode/tree/v2.0/start: cannot find package \"github.com/Artem-G/learn-chaincode/tree/v2.0/start\" in any of:\n\t/opt/go/src/github.com/Artem-G/learn-chaincode/tree/v2.0/start (from $GOROOT)\n\t/opt/gopath/_usercode_/780898440/src/github.com/Artem-G/learn-chaincode/tree/v2.0/start (from $GOPATH)\n\t/opt/gopath/src/github.com/Artem-G/learn-chaincode/tree/v2.0/start\n"
  },
  "id": 1
}

This is the request:

{
  "jsonrpc": "2.0",
  "method": "deploy",
  "params": {
    "type": 1,
    "chaincodeID": {
      "path": "https://github.com/Artem-G/learn-chaincode/tree/v2.0/start"
    },
    "ctorMsg": {
      "function": "init",
      "args": [
        "hi there"
      ]
    },
    "secureContext": "user_type1_0"
  },
  "id": 1
}

Request URL https://84f1361fd5734a419ada2257818abece-vp0.us.blockchain.ibm.com:5003/chaincode

altharp commented 7 years ago

The "/tree/v2.0" portion of the path to the chaincode could be part of the issue. There is a Stack Overflow post with a very similar issue that was resolved by removing part of the chaincode path. I would suggest first trying a chaincode path like https://github.com/Artem-G/learn-chaincode/start.

Artem-G commented 7 years ago

@altharp So true. Bluemix can't deploy from the branches! I put my code into 'master' and it went well Thanks

Here is the final

{
  "jsonrpc": "2.0",
  "method": "deploy",
  "params": {
    "type": 1,
    "chaincodeID": {
      "path": "https://github.com/Artem-G/learn-chaincode/start"
    },
    "ctorMsg": {
      "function": "init",
      "args": [
        "hi there"
      ]
    },
    "secureContext": "user_type1_0"
  },
  "id": 1
}