Installing Dependencies
Develop in the cloud with Gitpod
Optionally, and instead of installing dependencies locally, you can use Gitpod to launch a developer environment purely in the cloud, through your browser:
  1. 2.
    Grab a StreamingFast key from
  2. 3.
    Create a Gitpod account
  3. 4.
    Configure a STREAMINGFAST_KEY variable in your Gitpod account settings
  4. 5.
    Open your repository as a Gitpod workspace
  5. 6.
    The substream template comes with a Makefile that makes building and running the substream easy:
    1. 1.
      make build will rebuild your substream. Run this whenever you have made changes.
    2. 2.
      make stream will run the stream for a few blocks. As you make changes to your substream, you'll want to change this command to use your own substream modules and a block range more suitable to the data your indexing. Simply edit Makefile to do this.

Install the substreams CLI

If you haven't already, make sure that you install the substreams command-line interface.

Install Rust

Before we start creating any Substreams, we will need to setup our development environment. Substreams are written in the Rust programming language.
There are several ways to install Rust, but for the sake of brevity, this is the easiest:
curl --proto '=https' --tlsv1.2 -sSf | sh
source $HOME/.cargo/env # to configure your current shell

Install buf is a tool used to simplify the generation of typed structures in any language. It invokes protoc and simplifies a good number of things. Substreams packages are compatible with buf Images.

Install cmake and build-essential

For linux based machines cmake and build-essential is needed to install protoc-gen-prost cargo crate. There are multiple ways to do this, we can check out how to install cmake here and how to install build-essential here.
apt update
apt install cmake build-essential

Install protoc-gen-prost

Once cmake and build-essential are properly installed, we can install protoc-gen-prost crate to generate protobuf files.
cargo install protoc-gen-prost