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
  • Prerequisites
  • First Navigating the Dev Container
  • Building a Sink for Your Project
  • Deployment Options
  • Common Errors

Was this helpful?

Edit on GitHub
  1. Reference Material

Development Container Reference

Substreams Dev Container Reference

PreviousNever Miss DataNextSubstreams CLI

Last updated 4 months ago

Was this helpful?

The Substreams Dev Container is a tool to help you build your first project. You can either run it remotely through Github codespaces or locally by cloning the . Inside the Dev Container, the substreams init command sets up a code-generated Substreams project, allowing you to easily build a subgraph or an SQL-based solution for data handling.

Prerequisites

  • Ensure Docker and VS Code are up-to-date.

First Navigating the Dev Container

Upon entering the Dev Container, you can either build or import your own substreams.yaml and associate modules within the minimal path, or opt for the automatically generated Substreams paths. Then running Substreams Build generates the Protobuf files.

  • Minimal: Starts you with the raw block .proto and requires development. This path is intended for experienced users.

  • Non-Minimal: Extracts filtered data using network-specific caches and Protobufs taken from corresponding foundational modules. This path generates a working Substreams out of the box.

To publish your work with the broader community, publish your .spkg to using:

  • substreams registry login

  • substreams registry publish

Tip: If you run into any problems within the Dev Container, use the help command to access trouble shooting tools.

Building a Sink for Your Project

You can configure your Substreams project to query data either through a Subgraph or directly from an SQL database:

  • Subgraph: Run substreams codegen subgraph. This generates a project with a basic schema.graphql and mappings.ts file. You can customize these to define entities based on the data extracted by Substreams. For more information on configuring a Subgraph sink, see the .

  • SQL: Run substreams codegen sql for SQL-based queries. For more information on configuring a SQL sink, refer to the .

Deployment Options

To deploy a Subgraph, you can either run the graph-node locally using the deploy-local command or deploy to Subgraph Studio by using the deploy command found in the package.json file.

Common Errors

  • When running locally, make sure to verify that all Docker containers are healthy by running the dev-status command.

  • If you put the wrong start-block while generating your project, navigate to the substreams.yaml to change the block number, then re-run substreams build.

substreams-starter repository
Substreams registry
Subgraph documentation
SQL documentation