Created
May 20, 2018 19:11
-
-
Save vitiko/533f5943e4f3f9154c7a8ac36bc9c66d to your computer and use it in GitHub Desktop.
Cars chaincode base methods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Init initializes chain code - sets chaincode "owner" | |
func (cc *Chaincode) Init(stub shim.ChaincodeStubInterface) peer.Response { | |
// set owner of chain code with special permissions , based on tx creator certificate | |
// owner info stored in chaincode state as entry with key "OWNER" and content is serialized "Grant" structure | |
return owner.SetFromCreator(cc.router.Context(`init`, stub)) | |
} | |
// Invoke - entry point for chain code invocations | |
func (cc *Chaincode) Invoke(stub shim.ChaincodeStubInterface) peer.Response { | |
// delegate handling to router | |
return cc.router.Handle(stub) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment