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
  • Install the substreams CLI
  • Validation of installation
  • Install Other Developer Dependencies (Only for Substreams Developers)

Was this helpful?

Edit on GitHub
  1. Reference Material
  2. Substreams CLI

Install the CLI

StreamingFast Substreams CLI installation documentation

PreviousSubstreams CLINextAuthentication

Last updated 4 months ago

Was this helpful?

Install the substreams CLI

Used for connecting to endpoints, streaming data in real time, and packaging custom modules.

Homebrew installation

brew install streamingfast/tap/substreams

Docker Alias

You can use our published Substreams CLI Docker image an assign an alias to Docker. We mount the API token as SF_API_TOKEN in the alias so that credentials are known to the CLI running inside Docker.

alias substreams='docker run --rm -it -e="SF_API_TOKEN=$SF_API_TOKEN" ghcr.io/streamingfast/substreams'

Note: Expansion of $SF_API_TOKEN above happens at command runtime, so you must ensure that it is set correctly in your own host environment.

Pre-compiled binary installation

There are several CLI binaries available for different operating systems. Choose the correct platform in the .

If you are on MacOS, you can use the following command:

LINK=$(curl -s https://api.github.com/repos/streamingfast/substreams/releases/latest | awk "/download.url.*$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m)/ {print \$2}" | sed 's/"//g')
curl -L  $LINK  | tar zxf -

If you are on Linux, you can use the following command:

# Use correct binary for your platform
LINK=$(curl -s https://api.github.com/repos/streamingfast/substreams/releases/latest | awk "/download.url.*linux_$(uname -m)/ {print \$2}" | sed 's/"//g')
curl -L  $LINK  | tar zxf -

Installation from source

git clone https://github.com/streamingfast/substreams
cd substreams
go install -v ./cmd/substreams

Important: Add $HOME/go/bin to the system path if it's not already present.

Validation of installation

substreams --version

A successful installation will print the version that you have installed.

substreams version dev

Install Other Developer Dependencies (Only for Substreams Developers)

If you plan to build your own Substreams (i.e. write Rust code to extract data from the blockchain), you will need several dependencies to set up your developer environment:

Tip: Instructions are also provided for cloud-based Gitpod setups.

Rust installation

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env # to configure your current shell

wasm32-unknown-unknown target

Ensure you have the wasm32-unknown-unknown target installed on your Rust installation, if unsure, you can install it with:

rustup target add wasm32-unknown-unknown

Buf installation

Buf simplifies the generation of typed structures in any language. Buf uses a remote builder executed on the Buf server, so an internet connection is required to generate Rust bindings from Protobuf definitions.

Run the passing the --version flag to check the success of the installation.

Developing Substreams modules requires a working compilation environment.

There are . Install Rust through curl by using:

Visit the for additional information and .

Note: and are compatible.

CLI releases page
substreams CLI
Rust
several ways to install Rust
Buf website
installation instructions
Substreams packages
Buf images