I am new to hyperledger composer and I am trying to create a read only transaction in which I have to get information for 2 different assets and then do some post processing on it and return the combined and post processed result to the caller. I am unable to figure out how to do this in a composer transaction. It seems transactions are purely for data mutation and they seem to have a predefined shape of the result that is returned to the caller. Using queries.qry will not work as there is some post processing involved.
Asked
Active
Viewed 153 times
1 Answers
0
in a business network, you can create a Transaction you can getAssetRegistry()
etc or run a query (eg if that's how you 'derive' what two assets to list) in your TP function . You can then process the results within a business network but TP functions don't return 'data' - you would usually use a client App to do a nodeJS request
call on the transaction endpoint (above) via REST API or HTTPClient then process the results as you say. Eg https://ibm-blockchain.github.io/develop/integrating/call-out - or use Node-Red https://ibm-blockchain.github.io/develop/integrating/node-red
see also Hyperledger composer javascript return value for info on return value from a TP function.

Paul O'Mahony
- 6,740
- 1
- 10
- 15