Test Substreams Locally
Last updated
Was this helpful?
Last updated
Was this helpful?
You can run a Substreams server locally to run e2e testing.
It requires a local copy of full merged-blocks files for the range you want to test over. You can easily download those files from a Firehose endpoint.
Then run the Substreams software locally, and run tests against it
Install the firehose-core
single binary for most chains (those without chain-specific extensions) with brew:
or get a release from:
Run against an endpoint for the chain you're interested in. For example:
which will download merged blocks to your local disk. You might need to be authenticated.
Run:
Notes:
the --common-first-streamable-block
must be the lowest block available on disk, otherwise the server will fail to start.
if you need to do eth_calls
with the Ethereum, you can add: --substreams-rpc-endpoints https://example.com/json-rpc/somekeysometimes
the --substreams-state-bundle-size=10
flag will write smaller stores snapshot, suitable for dev
This will run a fully workable stack
Test with:
and enjoy.