Skip to main content

Quickstart

This 5-minute tutorial shows you how to grab a Fuel Squid SDK indexer template. At the end you’ll have a complete blockchain indexer that serves counts of LOG_DATA receipts from all Fuel contracts.

What you’ll get

Your Fuel indexer (squid) will:
  • Fetch all historical LOG_DATA receipts starting from a given block
  • Maintain a count of such receipts for each contract in a local PostgreSQL database
  • Start a GraphQL server with a rich API to query this data
This tutorial focuses on Fuel. For other chains, see the EVM Quickstart or Solana Quickstart.

Prerequisites

Before you begin, ensure you have:
1

(Optional) Install Squid CLI

Install the Squid CLI globally:
Verify installation by running sqd --version
Squid CLI is a multi-purpose utility tool for scaffolding and managing indexers, both locally and in SQD Cloud.
2

Scaffold the indexer project

This dataset has been retired. As SQD consolidates onto Portal, the Fuel and Starknet gateways were discontinued on June 1, 2026, and Eclipse (gateway and Portal dataset) on May 21, 2026. The endpoints listed for this network no longer respond. See the deprecation announcement for details.
Create a new squid project from the Fuel example:
or, if you skipped the installation of Squid CLI
3

Inspect the project structure

Explore the project structure:
Key files explained: - src/model/ - TypeORM model classes used in database operations - main.ts - Main executable containing data retrieval configuration and processing logic
The main.ts file first defines the data source object and configures its data retrieval options:
main.ts
Next, main.ts defines the data processing and storage logic. Data processing is defined in the batch handler, the callback that the run() function receives as its final argument:
main.ts
4

Install dependencies and build

Install dependencies and build the project:
Verify the build completed successfully by checking for the lib/ directory.
5

Start the database and processor

The processor continuously fetches data, decodes it, and stores it in PostgreSQL. All logic is defined in main.ts and is fully customizable.First, start a local PostgreSQL database (the template includes a Docker Compose file):
The processor connects to PostgreSQL using connection parameters from .env. Ensure the database is running before proceeding.
Apply database migrations:
Then start the processor:
The indexer is now running and will begin processing blocks.
6

Start the GraphQL API

Start the GraphQL API to serve the transfer data:
7

Query the data

You can now query your indexed data! Check it out at the GraphiQL playground at localhost:4350/graphql.