juno icon indicating copy to clipboard operation
juno copied to clipboard

Add ability to query a transaction from the database using its ID

Open tshakalekholoane opened this issue 3 years ago • 0 comments

This functionality will enable support for the get_transaction_id_by_hash and get_transaction_hash_by_id routes in the REST API.

The transaction id can be thought of as a global index of the transaction in the entire blockchain. For example, the last transaction in block 0 (which has 18 transactions) has an id 17. Similarly, the second transaction in block 1, has an id of 19.

While this information is not captured in the block response, a simple counter may be maintained or other such similar methods during the sync process to store this information.

tshakalekholoane avatar Jul 19 '22 10:07 tshakalekholoane