near / near-indexer-for-explorer

Watch NEAR network and store all the data from NEAR blockchain to PostgreSQL database
https://near-indexers.io/docs/projects/near-indexer-for-explorer
GNU General Public License v3.0
124 stars 56 forks source link

feat: compute circulating supply and store it in DB #136

Closed telezhnaya closed 3 years ago

telezhnaya commented 3 years ago

You can take a look at how it works at 34.141.101.9 (ask @khorolets for access)

tmux attach
cargo run --release -- --home-dir ~/.near/mainnet run --store-genesis --stream-while-syncing --allow-missing-relations-in-first-blocks 1000 --concurrency 0 sync-from-latest

The testing DB is available at 35.233.39.106, there are some numbers calculated.

It works well in general, but I am still thinking about working with threads. I am killing the thread if anything bad happens. On the one hand, that's exactly what I wanted to achieve. On the other, it's better to try to recreate the thread from time to time. Want to know your opinion, I guess the best solution will be born after the discussion.

telezhnaya commented 3 years ago

I fixed formatting, cargo fmt is calm both on my machine and at Bohdan's server, but CI formatter is still angry at me. The language version looks the same, 1.51.0

telezhnaya commented 3 years ago

Thank you so much @frol @khorolets, you've done amazing amount or work reviewing this. I've rewritten it almost from scratch 😄 Had to rebase it to the current master. All new changes are in the second commit. Please have a look again.

telezhnaya commented 3 years ago

@frol @khorolets please have a look

telezhnaya commented 3 years ago

@frol please have a look again