on EVM
Last updated
Was this helpful?
In this tutorial, you'll learn how to initialize a EVM-based Substreams project using the Substreams CLI (substreams init command).
The CLI installation is supported only on Linux and macOS. If you're using Windows, consider using the DevContainer environment, which launches a Linux-based virtual environment.
Tip: Using an AI coding assistant? Install the Substreams agent skills to get expert Substreams guidance while building.
Running substreams init will give you the option to choose between two EVM project options. Select the one that best fits your requirements:
evm-hello-world: Creates a simple Substreams that outputs the events of a smart contract. Depending on the blockchain that you choose (Mainnet, Arbitrum, Polygon), the smart contract address will be different (usually, it's the USDC token, if it's available on the chain).
evm-events-calls: Creates a Substreams that extracts and decodes EVM events and calls using the cached EVM Foundational Module, filtered by one or more smart contract addresses. Contract ABIs are retrieved from Etherscan. If an ABI isn’t available, you’ll need to provide it yourself.
Run substreams auth to create your account and generate an authentication token (JWT), then pass this token back as input.
Run substreams build to compile the project.
Run substreams gui to visualize and iterate on your extracted data.
Open the src/lib.rs file that has been generated.
Modify the transformations made to the data as needed. Every time you modify the code, you will have to recompile the project with substreams build.
To make your Substreams queryable (as opposed to direct streaming), you can automatically send the data to a SQL data by using the SQL sink or through PubSub.
You may find these additional resources helpful for developing your first EVM application.
The Dev Container Reference helps you navigate the container and its common errors.
The CLI reference lets you explore all the tools available in the Substreams CLI.
The Components Reference dives deeper into navigating the substreams.yaml.
Last updated
Was this helpful?
Was this helpful?

