Created
June 29, 2016 00:08
-
-
Save seanbarclay/c5d0c3453c0584b1d764841a54674fa5 to your computer and use it in GitHub Desktop.
Learn Chaincode Invoke Call
This file contains hidden or 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
Excerpt code from https://github.com/IBM-Blockchain/learn-chaincode/blob/master/finished/chaincode_finished.go... | |
func (t *SimpleChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) { | |
fmt.Println("invoke is running " + function) | |
// Handle different functions | |
if function == "init" { | |
return t.Init(stub, "init", args) | |
} else if function == "write" { | |
return t.write(stub, args) | |
} | |
fmt.Println("invoke did not find func: " + function) | |
return nil, errors.New("Received unknown function invocation") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment