我可以运行从以下官方路径chaincode: https://github.com/ibm-blockchain/learn-chaincode/finished github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02无法从我自己的Ubuntu终端上运行GitHub的hyperledger chaincode
# peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Function":"init", "Args": ["a","100", "b", "200"]}'
但不能从我自己的github路径运行chainncode: https://github.com/jeffyxia/hyperledger/trade
# peer chaincode deploy -p https://github.com/jeffyxia/hyperledger/trade -c '{"Function":"init", "Args": ["a","100", "b", "200"]}'
错误信息是:
错误:错误建筑chaincode:RPC错误:代码= 2 DESC =错误获取
chaincode package bytes: Error getting code 'go get' failed with error: "exit status 2"
# github.com/jeffyxia/hyperledger/hello_world
/go/_usercode_/519629987/src/github.com/jeffyxia/hyperledger/hello_world/chaincode_example01.go:31: cannot use new(SimpleChaincode) (type *SimpleChaincode) as type shim.Chaincode in argument to shim.Start:
*SimpleChaincode does not implement shim.Chaincode (wrong type for Init method)
have Init(*shim.ChaincodeStub, string, []string) ([]byte, error)
want Init(shim.ChaincodeStubInterface, string, []string) ([]byte, error)
补充信息: 的Ubuntu 16.04,而不去的语言环境中,使用PBFT algrithm。
如何解决这个问题,thx。