I am trying to run this code:
func main() {
lld, _ := shim.LogLevel("DEBUG")
fmt.Println(lld)
logger.SetLevel(lld)
fmt.Println(logger.IsEnabledFor(lld))
err := shim.Start(new(SampleChaincode))
if err != nil {
logger.Error("Could not start SampleChaincode")
} else {
logger.Info("SampleChaincode successfully started")
}
}
I am getting the following error:
> cannot use new(SampleChaincode) (type *SampleChaincode) as type
> shim.Chaincode in argument to shim.Start:
> *SampleChaincode does not implement shim.Chaincode (wrong type for Init method)
> have Init(shim.ChaincodeStubInterface, string, []string) ([]byte, error)
> want Init(shim.ChaincodeStubInterface) peer.Response