March 2019
Intermediate to advanced
636 pages
27h 50m
English
Now that we have finished setting up our channel and installing chaincode for trade, we need to implement functions to execute chaincode invocations. Our code for this lies in the invokeChaincode function in invoke-chaincode.js.
The procedure to invoke the chaincode is the same as we did for instantiation, and the code is similar as well. The caller must build a transaction proposal consisting of the name of the chaincode function to be invoked and the arguments to be passed to it. Just providing the chaincode ID (tradecc in our implementation) is sufficient to identify the chaincode process to guide the request to:
tx_id = client.newTransactionID();var request = { chaincodeId : Constants.CHAINCODE_ID, fcn: funcName, ...Read now
Unlock full access