March 2019
Intermediate to advanced
636 pages
27h 50m
English
Let us first consider a scenario that requires us to update (or upgrade) our trade chaincode. The addition of a new organization, which we just carried out in the previous section, necessitates certain changes in chaincode. As an example, let us consider the following code snippet in the acceptTrade function in chaincode/src/github.com/trade_workflow/tradeWorkflow.go:
// Accept a trade agreement func (t *TradeWorkflowChaincode) acceptTrade(stub shim.ChaincodeStubInterface, creatorOrg string, creatorCertIssuer string, args []string) pb.Response { // Access control: Only an Exporter Org member can invoke this transaction if !t.testMode && !authenticateExporterOrg(creatorOrg, creatorCertIssuer) { return shim.Error("Caller ...Read now
Unlock full access