Reputation: 45
I am using Hyperledger Composer and the Rest Api but I was wondering if when requesting a new transaction, I can return my query result instead of the newly created transaction that doesn't have any useful information in for me in it.
I could just use the query route from the API but I want to use a Transaction to safely provide data coming from my Assets to the query.
For example if I need to provide a the actual DateTime to the query, I prefer to do it from a transaction coming from Composer than a Date provided from another server that could be wrong or faked.
Upvotes: 0
Views: 457
Reputation: 189
Your question is not clear, but if you want to use pre-defined query in your transaction, refer https://hyperledger.github.io/composer/latest/tutorials/queries.
And you can return data from transaction. Read following https://hyperledger.github.io/composer/latest/reference/js_scripts
Upvotes: 3