Not able to use IBM Blockchain services after Bluemix 1.0 update (Hyperledger 0.6)

0 votes

My team and I are developing an app using Bluemix Blockchain services, and we were using the application just fine until the 1.0 update. We thought it could be an error related to the ibm-blockchain.js library, however we have tried deploying it via REST and we still get errors:

{
 "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 2'\n# github.com/ibm-blockchain/learn-chaincode/finished\n/go/_usercode_/493306176/src/github.com/ibm-blockchain/learn-chaincode/finished/chaincode_finished.go:38: undefined: shim.ChaincodeStubInterface\n/go/_usercode_/493306176/src/github.com/ibm-blockchain/learn-chaincode/finished/chaincode_finished.go:52: undefined: shim.ChaincodeStubInterface\n/go/_usercode_/493306176/src/github.com/ibm-blockchain/learn-chaincode/finished/chaincode_finished.go:67: undefined: shim.ChaincodeStubInterface\n/go/_usercode_/493306176/src/github.com/ibm-blockchain/learn-chaincode/finished/chaincode_finished.go:80: undefined: shim.ChaincodeStubInterface\n/go/_usercode_/493306176/src/github.com/ibm-blockchain/learn-chaincode/finished/chaincode_finished.go:99: undefined: shim.ChaincodeStubInterface\n"
     },
 "id": 1
}

Our service is still using the 0.5 version. We have also updated the local version to 1.0 and tried the same to see if the error was the same, and it seems like it is:

12:16:55.666 [devops] getChaincodeBytes -> ERRO 034 Error getting chaincode package bytes: Error getting code 'go get' failed with error: "exit status 1"
package github.com/VitorSousaCode/chaincodes/tree/master/final: cannot find package "github.com/VitorSousaCode/chaincodes/tree/master/final" in any of:
    /opt/go/src/github.com/VitorSousaCode/chaincodes/tree/master/final (from $GOROOT)
    /opt/gopath/_usercode_/796234422/src/github.com/VitorSousaCode/chaincodes/tree/master/final (from $GOPATH)
    /opt/gopath/src/github.com/VitorSousaCode/chaincodes/tree/master/final
12:16:55.671 [devops] Deploy -> ERRO 035 Error deploying chaincode spec: type:GOLANG chaincodeID:<path:"https://github.com/VitorSousaCode/chaincodes/tree/master/final" > ctorMsg:<args:"init" > secureContext:"user_type1_xxxxxxxxx"

Has anyone experienced anything similar? Does anybody know if there's any way for us to continue using the Go chaincode we have developed before without applying major changes?

Jun 20, 2018 in Blockchain by ariaholic
• 7,340 points
44 views

1 answer to this question.

0 votes

The bluemix service was using an older version v0.5 of the Hyperledger Fabric before November 10 2016. This version used the old syntax i.e shim.ChaincodeStub

The bluemix service status page shows that on 10-11-2016 the Fabric version on bluemix has been updated to v0.6.1. This newer version should be using the new syntax i.e shim.ChaincodeStubInterface.

Your deploy transaction is failing, because your the syntax in the chaincode is not consistent with the fabric version.

Note

  • If you are using a bluemix service with v0.5 version of fabric, then make sure your chaincode builds successfully with the shim.ChaincodeStub syntax

  • If you are using a buemix service with the v0.6 version of fabric , make sure the chaincode builds with the shim.ChaincodeStubInterface .For an example chaincode using v0.6 see chaincode_example02 v0.6 chaincode

answered Jun 20, 2018 by charlie_brown
• 7,720 points

Related Questions In Blockchain

0 votes
1 answer

Not being able to deploy blockchain demo app on bluemix

The car lease demo's "Deploy to Bluemix" ...READ MORE

answered Jul 11, 2018 in Blockchain by Shashank
• 10,350 points
32 views
0 votes
1 answer

Blockchain Hyperledger private key not able to send coins

From the code you posted, if(whichType == TX_SCRIPTHASH){//pay ...READ MORE

answered Sep 14, 2018 in Blockchain by digger
• 26,550 points
67 views
0 votes
1 answer

How do I use hyperledger fabric blockchain to build my own application?

To use fabric I would recommend you ...READ MORE

answered May 16, 2018 in Blockchain by Johnathon
• 9,080 points
93 views
0 votes
1 answer

Hyperledger Fabric 1.0 how to maintain privacy from OSNs?

Yes, OSNs can see all the transaction ...READ MORE

answered Jul 2, 2018 in Blockchain by Omkar
• 67,600 points
32 views
0 votes
1 answer
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,550 points
79 views
+1 vote
1 answer

How do i change the names of validating peers in IBM Bluemix blockchain?

IBM Bluemix Blockchain service Hyperledger Fabric v0.6 will ...READ MORE

answered Apr 10, 2018 in Blockchain by Perry
104 views
0 votes
1 answer

Not Able to register a user with Hyperledger-Fabric v1.1 preview

The error: "Certificate not found with AKI 'e729224e8b3f31784c8a93c5b8ef6f4c1c91d9e6e577c45c33163609fe40011' ...READ MORE

answered Jun 16, 2018 in Blockchain by charlie_brown
• 7,720 points
415 views
0 votes
1 answer