本文介绍了Bluemix 1.0更新(Hyperledger 0.6)之后无法使用IBM Blockchain服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我和我的团队正在使用Bluemix区块链服务开发一个应用程序,直到1.0更新为止,我们一直在使用该应用程序.我们认为这可能是与ibm-blockchain.js库有关的错误,但是我们尝试通过REST进行部署,但仍然出现错误:

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
}

我们的服务仍在使用0.5版本.我们还已经将本地版本更新为1.0,并尝试了相同版本以查看错误是否相同,并且看起来是这样的:

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"

有人经历过类似的经历吗?有人知道我们是否可以在不进行重大更改的情况下继续使用之前开发的Go链码吗?

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?

推荐答案

bluemix服务在2016年11月10日之前使用了Hyperledger Fabric的旧版本 v0.5 .该版本使用了旧语法.即shim.ChaincodeStub

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

bluemix服务状态页面显示,在2016年10月11日, bluemix上的结构版本已更新为 v0.6.1 .此较新的版本应使用新的语法,即shim.ChaincodeStubInterface.

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.

注意

  • 如果您正在使用带v0.5版本的fabric的bluemix服务,请确保使用shim.ChaincodeStub语法

如果要在Fabric的v0.6版本上使用buemix服务,请确保链代码使用shim.ChaincodeStubInterface构建.有关使用v0.6的示例链代码,请参见 chaincode_example02 v0.6链码

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

这篇关于Bluemix 1.0更新(Hyperledger 0.6)之后无法使用IBM Blockchain服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 23:52