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.91k stars 974 forks source link

Add stop block environment variable #3033

Closed evaporei closed 2 years ago

evaporei commented 2 years ago

We should have a way to stop the indexing of a deployment in a pre-determined block, like this: GRAPH_NODE_STOP_BLOCK=<deployment>:<number>,<deployment>:<number>.

evaporei commented 2 years ago

Similar feature implementation by @sduchesneau https://github.com/streamingfast/graph-node/commit/ece5270defe2104b0b35e7902eb16b12718f190f

https://github.com/graphprotocol/graph-node/pull/3079

sduchesneau commented 2 years ago

that implementation does not use an environment variable, bit this feature could be added. The idea in my fork/branch is to be able to run a validation (or comparison, performance, etc..) test by invoking graphman, so the stop-block can also be used to stop the whole process (not just a subgraph).

Additional work can be done on top of what I have there to launch the indexing with a provided(env var, etc.) value per subgraph.

azf20 commented 2 years ago

I think if our use case is performance testing, the graphman command will likely work - @otaviopace do you see a reason to have a different implementation? cc @lutter and @mangas who are also thinking about performance testing

evaporei commented 2 years ago

@azf20 no, I'll close this for now.