Overview
Subsquid functions as a data-access layer for web3 that operates through a decentralized network of nodes. Gateway runners serve as critical infrastructure, connecting users’ queries to this distributed data network. The gateway processes requests and routes them to relevant nodes, enabling access to verified blockchain historical data.
Gateway Runners Explained
Gateway runners allow data consumers — typically decentralized applications — to access the Subsquid Network without relying on centralized services. Each gateway binds to an on-chain address, with request capacity determined by locked $SQD token amounts. Operating your own gateway provides operational autonomy and cost reduction compared to third-party solutions.
Setup Requirements
To run a gateway, you need:
- Docker installation
- SQD tokens (in wallet or vesting contract)
- Arbitrum ETH (for transaction fees)
All gateways require on-chain registration and an associated SQD stake that determines request-serving capacity.
Installation Steps
- Generate key file:
docker run --rm subsquid/rpc-node:0.2.5 keygen > <KEY_PATH>
Copy the displayed peer ID for subsequent steps.
-
Register gateway:
- Visit https://network.subsquid.io
- Connect EVM wallet
- Navigate to “Gateways” tab
- Click “Add gateway”
- Complete registration form
- Toggle “Publicly available” if desired
-
Stake tokens:
- Click “Get CU” button
- Stake appropriate SQD amount
- Wait for activation at next epoch
-
Deploy gateway:
git clone https://github.com/subsquid/query-gateway
cd query-gateway
cp mainnet.env .env
echo KEY_PATH=<KEY_PATH> >> .env
docker compose up -d
Cost Structure
Subsquid employs “Compute Units” (CU) as query credits. Locked SQD tokens generate virtual CUs based on lock duration. Each query costs 1 CU. The locking mechanism includes a booster rewarding longer commitments — for example, 100 SQD locked for 3 years yields approximately 12% annual APY.
Data Access Methods
Squid SDK: Open-source TypeScript libraries enabling blockchain data retrieval and transformation via batch processing.
Direct API: Query blockchain data using HTTP requests or terminal commands via curl.
Subgraph Integration: Run subgraphs without full nodes using Subsquid’s Firehose adapter.
ApeWorx: Python framework supporting bulk blockchain data retrieval from Subsquid Network.
DipDup: Python indexer framework leveraging Subsquid Network for historical data.