Install Substreams CLI

    Install the Substreams CLI via Homebrew, binary or from source.

    brew install streamingfast/tap/substreams
    Binary · Modify for your OS
    LINK=$(curl -s | awk '/download.url.*linux/ {print $2}' | sed 's/"//g')
    curl -L $LINK | tar zxf -
    git clone
    cd substreams
    go install -v ./cmd/substreams

    Retrieve API Token

    Get your Pinax or StreamingFast API key to use with the CLI.

    Add to .bashrc or .zshrc
    function sftoken {
    export SUBSTREAMS_API_TOKEN=$(curl -s --data-binary '{"api_key":"'$STREAMINGFAST_API_KEY'"}' | jq -r .token)
    echo "Token set on SUBSTREAMS_API_TOKEN"
    Generate New API Token

    Run Substreams CLI

    Run Substream CLI commands against a Pinax or StreamingFast Firehose endpoint.

    Stream Command
    substreams run \ \
    db_out \
    -e \
    --start-block -7141
    GUI Command
    substreams gui \ \
    db_out \
    -e \
    --start-block -7141
    Info Command
    substreams info
    Mermaid Graph Command
    substreams graph