March 2019
Intermediate to advanced
636 pages
27h 50m
English
A chaincode query is somewhat simpler to implement as it involves the entire network, but simply requires communication from client to peer.
Client and channel handles should be created as in the previous stages, but this time, we will select just one or more peers from the caller's (or client's) organization to associate with the channel object. Then, we must create a query request (identical to an invocation proposal request) and submit it to the selected peers:
var request = { chaincodeId : Constants.CHAINCODE_ID, fcn: funcName, args: argList};channel.queryByChaincode(request);
The responses to the query can be collected and compared before being returned to the caller. The complete implementation can be found in ...
Read now
Unlock full access