Repository navigation
IOTA Watch: source-aware polling and cached reward snapshots with React Query #11922
Unanswered
molimao
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I maintain IOTA Watch, an independent, MIT-licensed monitoring dashboard for training and mining projects. This is a self-submitted implementation example, not a recommendation from the project teams.
The most useful React Query design choice here was keeping different sources separate: discovery/roster queries, per-hotkey reward queries and a USD quote query have their own query keys, refresh intervals and failure states. A successful page request must not make an older upstream sample look fresh.
We use
useQuery/useQueries,placeholderData: keepPreviousDatafor IOTA snapshots, and explicit source timestamps. Reward history and cumulative totals are merged independently, so a failure in one does not erase the other. A Hong Kong accounting-day key prevents yesterday’s daily amount from silently carrying into today. Unknown data stays null; a successfully returned zero stays zero.In the manually grouped device view, a wallet balance or monthly compute points are displayed as account metrics instead of being added to device daily earnings. Account-backed project queries include the signed-in user identity in the key. Their io.net / Vast.ai contracts currently have mocked verification; real-account verification is still pending.
Implementation: IOTA query hook, device reading hook, and reward merge logic. The interface is available in five languages.
Feedback on the query-key and snapshot-merging approach is welcome.
All reactions