juno
juno copied to clipboard
Add ability to query a transaction from the database using its ID
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.