mistakia / nano-community

Community gateway and knowledge hub for Nano (digital money)
https://nano.community
MIT License
28 stars 25 forks source link

feat: track & display information about unconfirmed block pool & confirmation latency #99

Open mistakia opened 8 months ago

mistakia commented 8 months ago

display the following information:

Core Tasks

Future Tasks

mistakia commented 8 months ago

I’m now saving confirmation latency for all confirmed blocks. I’ve added median confirmation latency to the nano.community network section as a first attempt at a simple single metric to describe confirmation latency (https://github.com/mistakia/nano-community/commit/e14ffb9ee7ab1429c47868449eb3ed1025ddbe2c). Also spun up a few endpoints to explore confirmation latency and the unconfirmed block pool, will follow up with a page to explore all this data.

Some work will be needed to improve the stability and performance of some queries. I also need to ensure that the bucketization is in parity with the reference implementation

API Endpoints:

Unconfirmed Accounts Summary

nano.community/api/nanodb/accounts/unconfirmed/summary

Returns the total number of accounts that have at least one unconfirmed block.

Filtered Unconfirmed Accounts

nano.community/api/nanodb/accounts/unconfirmed?[limit&offset&balance_min&balance_max&sort_by=unconfirmed_blocks&sort_order=desc]

Returns a list of accounts with unconfirmed blocks, filter by account balance with balance_min and balance_max, and sort by the number of unconfirmed_blocks or oldest_unconfirmed_block_timestamp.

Unconfirmed Blocks Summary

nano.community/api/nanodb/blocks/unconfirmed/summary

Returns the count of unconfirmed blocks by type/subtype as well as count by bucket

Confirmed Blocks Statistics

nano.community/api/nanodb/blocks/confirmed/summary?period=[1h|24h|7d|30d]

Returns median, minimum, and maximum confirmation latency statistics on all confirmed blocks over specified periods (1 hour, 24 hours, 7 days, 30 days), as well as the count of confirmed blocks, categorized into different balance buckets.