graphprotocol / graph-node

Graph Node indexes data from blockchains such as Ethereum and serves it over GraphQL
https://thegraph.com
Apache License 2.0
2.88k stars 952 forks source link

feature request: dynamic/scheduled block handlers #1542

Open adamsoffer opened 4 years ago

adamsoffer commented 4 years ago

Feature Request

Introduce the the ability to dynamically schedule handlers to run at specific blocks.

Use case (using the Livepeer subgraph as an example)

Livepeer’s staking protocol is round or “epoch” based. Rounds are based on ethereum blocks where every 5760 blocks (this is a configurable parameter) a new round begins. Currently, there doesn't exist a scalable means for indexing rounds. If we could schedule handlers at runtime (as opposed to inside the manifest file) we can index a new round at a specific block.

leoyvens commented 8 months ago

We shipped this! https://thegraph.com/docs/en/developing/creating-a-subgraph/#polling-filter

leoyvens commented 8 months ago

Hmm if you wanted to this at runtime, we actually don't support that yet.