> ## 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.

# 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](/en/data/evm)).

<Steps>
  <Step title="Install the Squid CLI">
    ```bash theme={"system"}
    npm i -g @subsquid/cli@latest
    sqd --version
    ```

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

  <Step title="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).
  </Step>

  <Step title="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.
  </Step>

  <Step title="Start PostgreSQL">
    ```bash theme={"system"}
    sqd up
    ```

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

  <Step title="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.
  </Step>

  <Step title="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
    ```
  </Step>
</Steps>

## What to change next

* Edit the `DataSourceBuilder` configuration in `src/main.ts` to select the [transactions](./reference/evm-stream/transactions), [logs](./reference/evm-stream/logs), [traces](./reference/evm-stream/traces), or [state diffs](./reference/evm-stream/state-diffs) your application needs. Remember to extend the [field selection](./reference/evm-stream/field-selection) 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](./reference/evm-rpc-stream) instead. For resilience to endpoint outages,
  combine Portal and RPC with the [EVM fallback source](./reference/evm-fallback) — see
  [High availability](./guides/advanced/high-availability).
* Migrating an existing pre-Portal squid instead? Follow the [Portal migration guide](./guides/migration/gateway-to-portal).


## Related topics

- [Quickstart](/en/sdk/squid-sdk/substrate/quickstart.md)
- [Bitcoin quickstart](/en/sdk/pipes-sdk/bitcoin/quickstart.md)
- [Tron quickstart](/en/sdk/pipes-sdk/tron/quickstart.md)
- [Hyperliquid fills quickstart](/en/sdk/pipes-sdk/hyperliquid/quickstart.md)
- [Solana Portal Quickstart](/en/portal/solana/quickstart.md)
