LogoLogo
Package RegistryThe Graph
  • Introduction
  • Getting Started
  • Tutorials
    • Develop Your First Substreams
      • on EVM
      • on Solana
        • Transactions & Instructions
        • Account Changes
      • on Cosmos
        • Injective
        • MANTRA
      • on Starknet
      • on Stellar
    • Publishing a Substreams Package
  • How-To Guides
    • Developing Substreams
      • on EVM
        • Exploring Ethereum
          • Mapping Blocks
          • Filter Transactions
          • Retrieve Events of a Smart Contract
      • on Solana
        • Explore Solana
          • Filter Instructions
          • Filter Transactions
        • SPL Token Tracker
        • NFT Trades
        • DEX Trades
      • on Cosmos
        • Injective
          • Simple Substreams Example
          • Foundational Modules
          • Dojo DEX USDT Volume Subgraph Example
    • Using a Substreams Sink
      • Substreams:SQL
      • Substreams:Subgraph
        • Triggers
        • Graph Out
      • Substreams:Stream
        • JavaScript
        • Go
      • Substreams:PubSub
      • Community Sinks
        • MongoDB
        • Files
        • Key-Value Store
        • Prometheus
    • EVM Extensions
      • Making eth_calls
    • Getting Started Using Rust and Protobuf
      • Rust
        • Option struct
        • Result struct
      • Protobuf Schemas
    • From Yellowstone to Substreams
  • Reference Material
    • Chains and endpoints
      • Ethereum Data Model
    • Never Miss Data
    • Development Container Reference
    • Substreams CLI
      • Install the CLI
      • Authentication
      • Substreams CLI reference
    • Substreams Components
      • Packages
      • Modules
        • Module types
        • Inputs
        • Output
        • Module handlers
        • Module handler creation
        • Indexes
        • Keys in stores
        • Dynamic data sources
        • Aggregation Windows
        • Parameterized Modules
      • Manifests Reference
    • Substreams Architecture
    • Graph-Node
      • Local Development
      • Publish to The Graph Network
    • Indexer Reference
      • Test Substreams Locally
    • Logging, Debugging & Testing
    • Change log
    • FAQ
  • Decentralized Indexing
    • What is The Graph?
Powered by GitBook
On this page
  • Step 1: Initialize Your EVM Substreams Project
  • Step 2: Visualize the Data
  • Step 2.5: (Optionally) Transform the Data
  • Step 3: Load the Data
  • Additional Resources

Was this helpful?

Edit on GitHub
  1. Tutorials
  2. Develop Your First Substreams

on EVM

PreviousDevelop Your First SubstreamsNexton Solana

Last updated 2 months ago

Was this helpful?

In this guide, you'll learn how to initialize an EVM-based Substreams project within the Dev Container.

If you prefer to begin locally within your terminal rather than through the Dev Container (VS Code required), refer to the .

Step 1: Initialize Your EVM Substreams Project

  1. Open the and follow the on-screen steps to initialize your project.

  2. Running substreams init will give you the option to choose between two EVM project options. Select the one that best fits your requirements:

    • evm-minimal: Creates a simple Substreams that extracts raw EVM block data and generates corresponding Rust code. This path will start you with the full raw block, you can navigate to the substreams.yaml (the manifest) to modify the input.

    • evm-events-calls: Creates a Substreams that extracts and decodes EVM events and calls using the cached , 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.

Step 2: Visualize the Data

  1. Run substreams auth to create your and generate an authentication token (JWT), then pass this token back as input.

  2. Now you can freely use the substreams gui to visualize and iterate on your extracted data.

Step 2.5: (Optionally) Transform the Data

Within the generated directories, modify your Substreams modules to include additional filters, aggregations, and transformations, then update the manifest accordingly. To learn more about this, visit the

Step 3: Load the Data

To make your Substreams queryable (as opposed to ), you can automatically generate a Subgraph (known as a or SQL-DB sink.

Subgraph

  1. Run substreams codegen subgraph to initialize the sink, producing the necessary files and function definitions.

SQL

  1. Run substreams codegen sql and choose from either ClickHouse or Postgres to initialize the sink, producing the necessary files.

  2. Run substreams-sink-sql to sink the data into your selected SQL DB.

Note: Run help to better navigate the development environment and check the health of containers.

Additional Resources

You may find these additional resources helpful for developing your first EVM application.

Dev Container Reference

CLI Reference

Substreams Components Reference

Create your within the mappings.ts and associated entities within the schema.graphql.

Build and deploy locally or to by running deploy-studio.

Run substreams build build the sink.

The helps you navigate the container and its common errors.

The lets you explore all the tools available in the Substreams CLI.

The dives deeper into navigating the substreams.yaml.

Substreams CLI installation guide
Dev Container
EVM Foundational Module
account
How-to-Guides
direct streaming
Substreams-powered subgraph
subgraph mappings
Subgraph Studio
Substreams:SQL
Dev Container Reference
CLI reference
Components Reference