🎏Substreams and Graph Node

Authors: [man4ela | catapulta.eth]

Substreams-powered subgraphs

This article explains how to configure your Graph node to be able to sync substreams-powered subgraphs on Starknet network

circle-info

Since Starknet is not an EVM-compatible chain, you must configure your Graph Node to use Firehose and Substreams

In order to serve Substreams-powered subgraphs, Graph Node must be configured with a Substreams provider for the relevant network, as well as a Firehose to track the chain head. These providers can be configured via a config.toml file:

Assuming you use Stakesquid's docker setup for your indexing operations you need to navigate to graph-node configs directory and modify your config.tmpl file:

cd graphprotocol-mainnet-docker

cd graph-node-configs

nano config.tmpl

Append or update the following section:

[chains.${CHAIN_1_NAME}]
shard = "primary"
protocol = "substreams"
provider = [
  { label = "substreams", details = { type = "substreams", url = "${CHAIN_1_GRPC}", keys = "", features=["compression"] } }
]

Then set the Environment variables by modifying .env file with Firehose configs:

circle-exclamation

Disable Extended Block Checks (Important)

Firehose for Starknet does not support extended blocks by default. You must disable this check or your subgraph will fail to sync.

In your compose-graphnode.yml (inside the index-node service), add:

Launch Graph-node:

References:

Last updated