> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Reach for SQD when you need onchain data without running a node or an indexer: decoded EVM logs and transactions, Solana instructions, Bitcoin transactions, Substrate events and calls, or Hyperliquid fills, over any block range on 110+ networks.
> To query directly, POST to https://portal.sqd.dev/datasets/{dataset}/stream. The full API is described at https://docs.sqd.dev/openapi.json, and responses to the stream endpoints are JSON Lines.
> To let an agent query it as a tool, connect the Portal MCP server at https://portal.sqd.dev/mcp.
> For Portal availability errors, stalled streams, or rate limiting, read https://status.sqd.dev/status.md. The status index at https://status.sqd.dev/llms.txt explains network and plan filters.
> Every page on this site is available as Markdown by appending .md to its URL.

# Quickstart

> Get an EVM blockchain indexer in 5 minutes with Squid SDK

This quickstart scaffolds the current EVM template, indexes ETH burn transactions, stores them in PostgreSQL, and exposes them through GraphQL.

## Prerequisites

* Node.js 20 or newer
* Git
* Docker with Compose

No data credentials are needed: the template streams data from a public SQD Network Portal dataset (see the [EVM networks list](https://docs.sqd.dev/en/data/evm.md)).

**1. Install the Squid CLI**

```bash theme={"system"}
npm i -g @subsquid/cli@latest
sqd --version
```

The version output has the form `@subsquid/cli/<version>`.

**2. Scaffold the current EVM template**

```bash theme={"system"}
sqd init hello-squid -t evm
cd hello-squid
npm i
```

The `evm` alias is maintained by the CLI. It currently retrieves [`subsquid-labs/squid-evm-template`](https://github.com/subsquid-labs/squid-evm-template).

The project has this layout:

**hello-squid**

**abi**

**README.md**

**db**

**migrations**

**1674844779131-Data.js**

**src**

**abi**

**multicall.ts**

**main.ts**

**model**

**generated**

**burn.model.ts**

**index.ts**

**marshal.ts**

**index.ts**

**.env**

**.squidignore**

**commands.json**

**docker-compose.yml**

**package.json**

**schema.graphql**

**squid.yaml**

**tsconfig.json**

* `src/main.ts`: the data source and the batch handler.
* `schema.graphql`: the data model. `sqd codegen` generates the TypeORM classes in `src/model/generated/` from it.
* `commands.json`: the scripts behind `sqd build`, `sqd up`, and `sqd down`.
* `squid.yaml`: the manifest that `sqd run .` starts.
* `db/migrations/`: database migrations, applied before the processor starts.
* `abi/`: the place for contract ABI JSON files. `sqd typegen` generates TypeScript modules from them in `src/abi/`.

**3. Build the project**

```bash theme={"system"}
sqd build
```

The template defines `build` in `commands.json`. The command generates JavaScript in `lib/` and stops on TypeScript errors.

**4. Start PostgreSQL**

```bash theme={"system"}
sqd up
```

This runs the template's Docker Compose service with the connection settings from `.env`.

**5. Run the processor and GraphQL server**

```bash theme={"system"}
sqd run .
```

The CLI starts the processor and GraphQL services declared in `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`](./reference/evm-stream), requesting transactions sent to the zero address:

```typescript src/main.ts theme={"system"}
const dataSource = new DataSourceBuilder()
  .setPortal('https://portal.sqd.dev/datasets/ethereum-mainnet')
  .setFields({
    block: {timestamp: true},
    transaction: {hash: true, from: true, value: true},
  })
  .addTransaction({
    where: {to: ['0x0000000000000000000000000000000000000000']},
  })
  .build()
```

The [`run()` call from `@subsquid/batch-processor`](./reference/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 [`http://localhost:4350/graphql`](http://localhost:4350/graphql) and run:

```graphql theme={"system"}
query RecentBurns {
  burns(limit: 10, orderBy: block_DESC) {
    id
    block
    address
    value
    txHash
  }
}
```

Stop the CLI with `Ctrl+C`. Remove the local database container with:

```bash theme={"system"}
sqd down
```

## What to change next

* Edit the `DataSourceBuilder` configuration in `src/main.ts` to select the [transactions](https://docs.sqd.dev/en/sdk/squid-sdk/evm/reference/evm-stream/transactions.md), [logs](https://docs.sqd.dev/en/sdk/squid-sdk/evm/reference/evm-stream/logs.md), [traces](https://docs.sqd.dev/en/sdk/squid-sdk/evm/reference/evm-stream/traces.md), or [state diffs](https://docs.sqd.dev/en/sdk/squid-sdk/evm/reference/evm-stream/state-diffs.md) your application needs. Remember to extend the [field selection](https://docs.sqd.dev/en/sdk/squid-sdk/evm/reference/evm-stream/field-selection.md) with every field your handler reads.
* Edit `schema.graphql`, then run `sqd codegen` and `sqd migration:generate` after model changes.
* Indexing a network without a Portal dataset? Build the source with the
  [EVM RPC source](https://docs.sqd.dev/en/sdk/squid-sdk/evm/reference/evm-rpc-stream.md) instead. For resilience to endpoint outages,
  combine Portal and RPC with the [EVM fallback source](https://docs.sqd.dev/en/sdk/squid-sdk/evm/reference/evm-fallback.md) — see
  [High availability](https://docs.sqd.dev/en/sdk/squid-sdk/evm/guides/advanced/high-availability.md).
* Migrating an existing pre-Portal squid instead? Follow the [Portal migration guide](https://docs.sqd.dev/en/sdk/squid-sdk/evm/guides/migration/gateway-to-portal.md).


## Related topics

- [Quickstart](https://docs.sqd.dev/en/sdk/squid-sdk/solana/quickstart.md)
- [Bitcoin quickstart](https://docs.sqd.dev/en/sdk/pipes-sdk/bitcoin/quickstart.md)
- [Tron quickstart](https://docs.sqd.dev/en/sdk/pipes-sdk/tron/quickstart.md)
- [Hyperliquid fills quickstart](https://docs.sqd.dev/en/sdk/pipes-sdk/hyperliquid/quickstart.md)
- [EVM Portal Quickstart](https://docs.sqd.dev/en/portal/evm/quickstart.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.