How do I find a transaction by txID (node.js)

Viewed 371

How do I find a transaction by txID? In version 1.4(Fabric Node SDK) there was a queryTransaction method, but in 2.0 it is not, is there any replacement for it?

P.S I tried to get the transaction this way, but I get nothing

const result = await ctx.stub.getState(txId)
1 Answers

If you get nothing, it is probably because the transaction does not exist in the state (it has not been saved to CouchDB/LevelDB). You have probably endorsed (simulated) the transaction, but it has not been committed yet.

Related