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

# SQD Network components

> The services that store, assign, route, and serve SQD Network data.

SQD Network is a set of services with different responsibilities. Finalized
blockchain data is written to chunk storage and copied to worker disks. Recent
chain-tip data follows a separate path through HotblocksDB. Portal chooses one
of these sources for each request. Smart contracts record participation and
token accounting, but they do not carry block data or query results.

```mermaid theme={"system"}
flowchart TB
  sources["Blockchain data sources"] --> archiveIngest["Archive ingestion"]
  sources --> dataService["Chain-specific data service"]
  archiveIngest --> storage["Persistent chunk storage"]
  storage --> workers["Worker nodes"]
  dataService -->|"blocks, forks, and finality"| hotblocks["HotblocksDB<br/>bounded recent window"]
  scheduler["Scheduler"] --> assignment["Assignment artifact"]
  assignment --> workers
  assignment --> portal["Portal"]
  scheduler -->|"archival dataset height"| retain["Hotblocks-retain"]
  retain -->|"retention lower bound"| hotblocks
  workers <--> portal
  hotblocks <--> portal
  portal --> client["Client"]
  contracts["Smart contracts"] -. "registration and accounting" .-> workers
  contracts -. "network status and allocations" .-> portal
```

## Data services

| Component                   | Responsibility                                                                                                                                                                                                |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Archive ingestion           | Reads finalized blocks from configured sources, validates their order, and writes chunk files to persistent storage.                                                                                          |
| Persistent chunk storage    | Holds the source copy of archival chunks from which workers download their assignments. The current implementation uses S3-compatible object storage.                                                         |
| Workers                     | Keep assigned chunks on local disk and execute queries against those chunks.                                                                                                                                  |
| Chain-specific data service | Reads a chain source and exposes blocks, fork signals, and finality signals to HotblocksDB. The current EVM service reads an RPC endpoint; other chain families require a compatible service.                 |
| HotblocksDB                 | Maintains a bounded, contiguous, fork-aware window near each configured dataset's head and executes range queries over that window. It is not an archival store.                                              |
| Hotblocks-retain            | Reads the last indexed archival height from scheduler status and, after the assignment becomes effective plus a configured delay, updates the HotblocksDB retention lower bound. It does not copy block data. |
| Portal                      | Accepts HTTP requests. It sends archival requests to assigned workers and forwards recent requests to HotblocksDB, then streams the selected source's response to the client.                                 |

## Coordination services

| Component                | Responsibility                                                                                                       |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------- |
| Scheduler                | Reads the known chunks and worker set, calculates which workers should hold each chunk, and publishes an assignment. |
| Assignment publisher     | Makes the current network state and compressed assignment available to workers and Portal.                           |
| Peer-to-peer transport   | Carries worker queries, results, heartbeats, and logs over libp2p and QUIC.                                          |
| Bootnodes                | Help a node find peers when it first joins the peer-to-peer network.                                                 |
| Observers and collectors | Record peer reachability, worker status, heartbeats, and query logs for operators.                                   |
| Smart contracts          | Record worker registration, bonds, delegation, network parameters, allocations, and rewards on Arbitrum.             |

Portal does not combine worker and HotblocksDB records in one response. The
request's first block determines the source, and a later client request can cross
the boundary. See [How real-time data is
served](/en/network/introduction/how-real-time-data-is-served).

## Continue through the architecture

<CardGroup cols={2}>
  <Card title="From blocks to chunks" icon="database" href="/en/network/introduction/blocks-to-chunks">
    Follow finalized blocks into storage and onto worker disks.
  </Card>

  <Card title="Scheduling and replication" icon="chart-line" href="/en/network/introduction/scheduling-and-replication">
    See how the current scheduler builds a worker assignment.
  </Card>

  <Card title="How a query is served" icon="terminal" href="/en/network/introduction/how-a-query-is-served">
    Follow an archival request from Portal to a worker and back.
  </Card>

  <Card title="How real-time data is served" icon="clock" href="/en/network/introduction/how-real-time-data-is-served">
    Follow recent blocks through HotblocksDB and Portal.
  </Card>

  <Card title="Onchain and offchain" icon="link" href="/en/network/introduction/onchain-and-offchain">
    See which records are onchain and which work happens offchain.
  </Card>
</CardGroup>

## Implementation sources

This page is based on the current public implementations:

* [Network transport and assignment crates](https://github.com/subsquid/sqd-network)
* [Data processing and archive services](https://github.com/subsquid/data)
* [Worker node](https://github.com/subsquid/worker-rs)
* [Scheduler](https://github.com/subsquid/network-scheduler)
* [Portal](https://github.com/subsquid/sqd-portal)
* [Network contracts](https://github.com/subsquid/subsquid-network-contracts)


## Related topics

- [SQD Network](/en/network/overview.md)
- [Whitepaper](/en/network/whitepaper.md)
- [Private Portal setup](/en/portal/self-hosting.md)
- [Indexing Fuel Network data](/en/sdk/squid-sdk/fuel/examples-tutorials/indexing-receipts.md)
- [Tokenomics](/en/network/tokenomics.md)
