简体   繁体   中英

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

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?

The bluemix service was using an older version v0.5 of the Hyperledger Fabric before November 10 2016. This version used the old syntax ie 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 ie 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM