Hyperledger Fabric cannot run chaincode from github on Ubuntu terminal

0 votes

I can run the chaincode from the following official path. but cannot run chainncode from my own github path

the error info is:

Error: Error building chaincode: rpc error: code = 2 desc = Error getting

chaincode package bytes: Error getting code 'go get' failed with error: "exit status 2"
# <path>
/go/_usercode_/519629987/src/<path>/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)

How to solve this?

Oct 31, 2018 in Blockchain by digger
• 26,740 points
696 views

1 answer to this question.

0 votes

Like the error says:

*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)

You need to replace stub *shim.ChaincodeStub with stub shim.ChaincodeStubInterface​

answered Oct 31, 2018 by Omkar
• 69,210 points

Related Questions In Blockchain

+1 vote
2 answers

How to return value from a chaincode in Hyperledger Fabric?

Hyperledger Fabric supports only 2 types of ...READ MORE

answered Jun 13, 2018 in Blockchain by Perry
• 17,100 points
2,609 views
+2 votes
3 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,237 views
0 votes
1 answer
0 votes
1 answer

Hyperledger Fabric: Cannot update chaincode

First, stop and delete all the containers: docker ...READ MORE

answered Oct 31, 2018 in Blockchain by Omkar
• 69,210 points
1,218 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP