graphprotocol / support

Community support for the Hosted Service of The Graph
https://thegraph.com/
10 stars 3 forks source link

Suggestion: Basic state storage API outside of entities #11

Open fubhy opened 5 years ago

fubhy commented 5 years ago

I think it might make sense to have a secondary state storage layer that does not get exposed as an entity but is used to control (e.g. filter / reduce / etc.) call / event / block handling.

Example: I want to add a block handler to recalculate something periodically but don't want it to run on every single block. In that case, one could store a state value in the form of the block timestamp and only run it if the data is state (state value is older than 1 day compared to current processed block timestamp).