safe-client-gateway
safe-client-gateway copied to clipboard
Implement method to get indexing status
Description
The Web would like to show the indexing status of the Transaction Service in the UI.
Semantically, the information-to-be-shown is:
- Is the latest block synced?
- How long since the last sync?
Requirements
- Investigate implications of including the aforementioned in the Safe info. endpoint or if a new one is better. (The Web is already polling for the Safe info.)
- In the decided endpoint, return from the
/v1/about/indexing/
endpoint of the Transaction Service:
- The
synced
flag - The (cached) block timestamp of the oldest synced block (either
erc20BlockNumber
ormasterCopiesBlockNumber
), obtained via RPC request.
Note: the Transaction Service already caches the /v1/about/indexing/
endpoint for 15 seconds. On top of this, we need to adjust our blockchain datasource to cache (at least for block timestamp retrieval, to begin with).