1. Setup

Install Rust

  • Install Rust, you can do so with the following command:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Install Substreams

  • Install Substreams CLI, you can either use brew:

    brew install streamingfast/tap/substreams

    use precompiled binaries

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

    or compile from source:

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

Create a new package

  1. Start by making a local copy of the Propeller Protocol Lib repository:\

    git clone https://github.com/propeller-heads/propeller-protocol-lib
  2. Create a new directory for your integration by copying the template, rename all the references to ethereum-template to [CHAIN]-[PROTOCOL_SYSTEM]:

    cp -r ./substreams/ethereum-template ./substreams/[CHAIN]-[PROTOCOL_SYSTEM]
  3. Now, generate the required protobuf code by running:

    substreams protogen substreams.yaml --exclude-paths="sf/substreams,google"
  4. Next, register the new package within the workspace by adding it to the members list in substreams/Cargo.toml.