How to do partial Transaction search using SDK-Node methods of Hyperledger Fabric

40 Views Asked by At

Is there a way to search transaction details by passing partial transaction-Id in blockchain list, using SDK-node method from Hyperledger fabric network.

I Tried using contract.evaluateTransaction('GetTransactionByID',channel_Name,txnId) SDK-Node Method, but it only works with full transaction-Id of block. And I'm looking for Sdk-node method to search using partial transaction-Id.

1

There are 1 best solutions below

0
On

Somebody else might have better information but I don't know of any out-of-the box mechanism to query for a partial transaction ID in Hyperledger Fabric. I am not sure of the value of being able to search on a partial transaction ID since the transaction ID is the SHA-256 hash of a cryptographic nonce and the submitter's identity (typically an X.509 certificate PEM). Different transaction IDs, even from the same submitter or submitted at similar times, will bear no similarity to each other.

If this capability is still useful to you then you could enable it yourself by populating an off-chain datastore of all the valid transactions from the blockchain in a structure that allows you to search on partial transaction ID. You would then search your off-chain datastore rather than using Fabric directly. The off_chain_data Fabric sample demonstrates how transaction information can be retrieved from Fabric to build and maintain an off-chain datastore.