1. Setup Setting up your machine to develop indexing integrations.
Install Rust
Install Rust , you can do so with the following command:
Copy curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Install Substreams
Install Substreams CLI , you can either use brew:
Copy brew install streamingfast/tap/substreams
use precompiled binaries
Copy # 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:
Copy 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:
Copy 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-template
to [CHAIN]-[PROTOCOL_SYSTEM]
:
Copy cp -r ./substreams/ethereum-template ./substreams/[CHAIN]-[PROTOCOL_SYSTEM]
Now, generate the required protobuf code by running:
Copy 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
.