时,虽然按照“中的步骤部署你的chaincode
从IBM Bluemix
Blockchain
文档,我发现了以下错误:IBM hyperlegder面料Bluemix实现 - errror部署chaincode
响应体
{
"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/VrushaliW1/BluemixApp1\n/opt/gopath/_usercode_/583850129/src/github.com/VrushaliW1/BluemixApp1/Asgn1.go:38: stub.GetFunctionAndParameters undefined (type shim.ChaincodeStubInterface has no field or method GetFunctionAndParameters)\n/opt/gopath/_usercode_/583850129/src/github.com/VrushaliW1/BluemixApp1/Asgn1.go:75: stub.GetFunctionAndParameters undefined (type shim.ChaincodeStubInterface has no field or method GetFunctionAndParameters)\n/opt/gopath/_usercode_/583850129/src/github.com/VrushaliW1/BluemixApp1/Asgn1.go:193: cannot use new(SimpleChaincode) (type *SimpleChaincode) as type shim.Chaincode in argument to shim.Start:\n\t*SimpleChaincode does not implement shim.Chaincode (wrong type for Init method)\n\t\thave Init(shim.ChaincodeStubInterface) ([]byte, error)\n\t\twant Init(shim.ChaincodeStubInterface, string, []string) ([]byte, error)\n"
},
"id": 0
}
参考以下链接: IBM Blockchain (Hyperledger) - "Error when deploying chaincode"
"Error getting chaincode package bytes" when deploying chaincode on hyperledger via REST
go代码正确地构建,但仍然出现'Shim interface'问题的失败错误。 Go代码仍然有问题吗?
Andrew Tharp,非常感谢你的链接。事情确实解决了这个问题。现在我正在坚持'QuerySpec'的第二步。我会再搜索一下。还有一件事我不明白的是,当我在cmd上构建它时,Go代码并没有给我任何'Shim'的错误,所以我认为Go代码中的一切都是goo。但是Bluemix的'DeploySpec'只能在您提供链接时更改代码。 – VrushaliMphatek