1. Setup
Setting up your machine to develop indexing integrations.
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
- Start by making a local copy of the Propeller Protocol Lib repository: - git clone https://github.com/propeller-heads/propeller-protocol-lib
- Create a new directory for your integration by copying the template, rename all the references to - ethereum-templateto- [CHAIN]-[PROTOCOL_SYSTEM]:- cp -r ./substreams/ethereum-template ./substreams/[CHAIN]-[PROTOCOL_SYSTEM]
- Now, generate the required protobuf code by running: - substreams protogen substreams.yaml --exclude-paths="sf/substreams,google"
- Next, register the new package within the workspace by adding it to the members list in - substreams/Cargo.toml.
Last updated