Prerequisites
- Node.js 20 or newer
- Git
- Docker with Compose
1
Install the Squid CLI
@subsquid/cli/<version>.2
Scaffold the current EVM template
evm alias is maintained by the CLI. It currently retrieves subsquid-labs/squid-evm-template.3
Build the project
build in commands.json. The command generates JavaScript in lib/ and stops on TypeScript errors.4
Start PostgreSQL
.env.5
Run the processor and GraphQL server
squid.yaml.
The processor command applies pending database migrations before it starts.The template’s src/main.ts builds a data source with DataSourceBuilder from @subsquid/evm-stream, requesting transactions sent to the zero address:src/main.ts
run() call from @subsquid/batch-processor then drives the batch handler, which turns each transaction into a Burn entity and inserts the batch through ctx.store. The Portal stream covers real-time data as well, all the way to the unfinalized chain head — no additional endpoints are needed.6
Query indexed data
Open Stop the CLI with
http://localhost:4350/graphql and run:Ctrl+C. Remove the local database container with:What to change next
- Edit the
DataSourceBuilderconfiguration insrc/main.tsto select the transactions, logs, traces, or state diffs your application needs. Remember to extend the field selection with every field your handler reads. - Edit
schema.graphql, then runsqd codegenandsqd migration:generateafter model changes. - Indexing a network without a Portal dataset? Build the source with the EVM RPC source instead. For resilience to endpoint outages, combine Portal and RPC with the EVM fallback source — see High availability.
- Migrating an existing pre-Portal squid instead? Follow the Portal migration guide.