Reputation: 525
If I need the history of some state address what should I do ?
Is it possible to use the REST API to retrieve all the transactions that changed a leaf state address ?
Or the only way to gather the "history" is by running trough all the transactions and gathering only the ones that I need ?
Upvotes: 3
Views: 274
Reputation: 256
The history of state can be retrieved by querying the state endpoint with the different head block ids. To get transactions that changed the state, each transactions will have to be queried.
If possible, a good pattern to follow would be to have an event listener that monitor state changes and keep track of changes and the needed transaction ids in a separate DB.
Upvotes: 4