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
    • Using a Substreams Sink
      • Substreams:SQL
        • Relational Mappings
        • db_out Module
      • 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
    • Substreams:SQL
      • Reorg Handling
    • Indexer Reference
      • Test Substreams Locally
    • Logging, Debugging & Testing
    • Change log
    • FAQ
  • Decentralized Indexing
    • What is The Graph?
Powered by GitBook
On this page
  • The Substreams Registry
  • Using a Package
  • Creating a Package

Was this helpful?

Edit on GitHub
  1. Reference Material
  2. Substreams Components

Packages

Learn about basics of Substreams packages

PreviousSubstreams ComponentsNextModules

Last updated 5 months ago

Was this helpful?

There are a lot of developers building Substreams and creating very useful transformations that can be reused by other people. Once a Substreams is developed, you can pack it into a Substreams package and share it with other people!

Essentially, a Substreams package is a ready-to-consume binary file, which contains all the necessary dependencies (manifest, modules, protobufs...). The standard file extension for a Substreams package is .spkg.

The Substreams Registry

In order to facilitate how developers share Substreams packages, the Substreams Registry (https://substreams.dev) was created. In the Registry, developers can discover and push Substreams.

For example, the ERC20 Balance Changes package is stored at the registry (https://substreams.dev/streamingfast/erc20-balance-changes/v1.1.0).

Using a Package

You can easily run a Substreams package by inputting the .spkg file in the CLI:

substreams gui \
 erc20-balance-changes@latest \
 map_balance_changes \
 -e mainnet.eth.streamingfast.io:443 \
 --start-block 1397553 \

Creating a Package

You can create a Substreams package by executing the substreams pack command in the CLI. Given a Substreams project, you can create a new package from a manifest (substreams.yaml):

substreams pack ./substreams.yaml

Package Dependencies

Developers can use modules and protobuf definitions from other Substreams packages when imports is defined in the manifest.

Important: To avoid potential naming collisions select unique .proto filenames and namespaces specifying fully qualified paths.

Local Protobuf filenames take precedence over the imported package's proto files.