Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

To get the validators&nominators history record of reward, is trouble #1435

Closed
0xthreebody opened this issue Jan 15, 2019 · 2 comments
Closed
Labels
Z7-question Issue is a question. Closer should answer.

Comments

@0xthreebody
Copy link

0xthreebody commented Jan 15, 2019

Polkawallet project to need query the record of validators&nominators history reward. is very trouble. Requires underlying support. Or there have any easier way to get this information.

@rphmeier
Copy link
Contributor

You should be able to watch for storage updates to the event storage, and look for reward events.
To look into history, the storage-changes-tree should be possible to inspect.

If your use case is to query for all rewards that have ever happened in the history, then this is an antipattern. What if the chain was 10 million blocks? This query would take ages regardless.

@0xthreebody
Copy link
Author

Everyone involved in staking different roles wants to see the data of their own rewards. So I want to store all the reward information for the history in the local database and cache. I can calculate the reward balance of the specified account through the reward rule, but the condition of calculating the rule is to calculate the balance at the historical moment of the account and the staking state. There have some unknown info.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Z7-question Issue is a question. Closer should answer.
Projects
None yet
Development

No branches or pull requests

2 participants