-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: compute circulating supply and store it in DB #136
Conversation
I fixed formatting, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! A few comments here and there. Overall great effort!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not finished the full review just yet, but decided to share the preliminary review since it is already not tiny.
36d960a
to
7eb6d4f
Compare
19b6442
to
7fc0ef6
Compare
Thank you so much @frol @khorolets, you've done amazing amount or work reviewing this. |
cleanup by fmt the thread is alive in any scenario (no except/panic/etc) use same connection to DB (pool) if possible mark circulating supply logging with my own AGGREGATED tag check that we calc circulating supply only for mainnet add documentation unify logic of computing historical and current circ supply massive renaming in the DB reorder files
7fc0ef6
to
f8bd85a
Compare
src/aggregated/circulating_supply/circulating_supply_provider.rs
Outdated
Show resolved
Hide resolved
src/aggregated/circulating_supply/circulating_supply_provider.rs
Outdated
Show resolved
Hide resolved
src/aggregated/circulating_supply/circulating_supply_provider.rs
Outdated
Show resolved
Hide resolved
src/aggregated/circulating_supply/circulating_supply_provider.rs
Outdated
Show resolved
Hide resolved
src/aggregated/circulating_supply/circulating_supply_provider.rs
Outdated
Show resolved
Hide resolved
src/aggregated/circulating_supply/circulating_supply_provider.rs
Outdated
Show resolved
Hide resolved
src/aggregated/circulating_supply/circulating_supply_provider.rs
Outdated
Show resolved
Hide resolved
src/aggregated/circulating_supply/circulating_supply_provider.rs
Outdated
Show resolved
Hide resolved
c494e1e
to
7ce7b88
Compare
@frol @khorolets please have a look |
src/main.rs
Outdated
const INDEXER_FOR_EXPLORER: &str = "indexer_for_explorer"; | ||
const AGGREGATED: &str = "aggregated"; | ||
const INTERVAL: std::time::Duration = std::time::Duration::from_millis(100); | ||
const MAX_DELAY_TIME: std::time::Duration = std::time::Duration::from_secs(120); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI, these start bothering me. There is no action item at the moment, but before we extend indexer-for-explorer with even more background work, let's consider whether we need those and how to name those properly.
aggregated
is too generic naming and it is not immediately clear why this const is even defined (indexer_for_explorer
is not much better, but at least it is a name of the package, and kind of makes sense to use in the logging.
src/aggregated/circulating_supply/circulating_supply_provider.rs
Outdated
Show resolved
Hide resolved
src/aggregated/circulating_supply/circulating_supply_provider.rs
Outdated
Show resolved
Hide resolved
src/aggregated/circulating_supply/circulating_supply_provider.rs
Outdated
Show resolved
Hide resolved
@frol please have a look again |
You can take a look at how it works at
34.141.101.9
(ask @khorolets for access)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.