--config command line flag.
Configuration Structure
The TOML configuration file consists of four main sections:[chains]
Sets endpoints to blockchain clients
[store]
Describes available databases and shards
[ingestor]
Sets the node responsible for block ingestion
[deployment]
Describes how to place newly deployed subgraphs
Many configuration sections support environment variable expansion, especially Postgres connection strings. The official
graph-node Docker image includes envsubst for complex use cases.Basic Configuration
The simplest configuration is equivalent to using the--postgres-url command line option:
Store Configuration
The[store] section defines database connections and sharding setup. At minimum, you must configure a primary shard.
Single Database Setup
Connection String Format
Theconnection string must be a valid libpq connection string. Environment variables embedded in the string are expanded before passing to Postgres.
Connection Pool Size
Each shard must specify how many database connections eachgraph-node instance maintains in its connection pool.
Fixed Pool Size
Fixed Pool Size
Set a single value for all nodes:
Rule-Based Pool Size
Rule-Based Pool Size
Use different pool sizes for different node types based on Rules are checked in order, and the first matching rule is used. If no rule matches, configuration loading fails.
node_id patterns:Chain Configuration
The[chains] section controls blockchain provider connections and metadata storage.
Chain Structure
Configure a chain namedmainnet in the [chains.mainnet] section:
Chain Parameters
shard: Database shard where chain data is storedprotocol: Protocol type (ethereum,near,cosmos,arweave,starknet). Default:ethereumpolling_interval: Block ingestor polling interval in milliseconds. Default:500amp: Network name used by AMP for this chain. Defaults to chain name. Set when AMP uses different naming (e.g.,amp = "ethereum-mainnet"for chain namedmainnet)provider: List of providers for this chain
Provider Configuration
Each provider has:label: Provider name appearing in logsdetails: Provider connection details
Provider Details
type:web3(default),firehose, orweb3calltransport:rpc(default),ws, oripcurl: Provider endpoint URLfeatures: Array of supported features:traces: Supportsdebug_traceBlockByNumberfor call tracingarchive: Archive node with full historical stateno_eip1898: Doesn’t support EIP-1898 (block parameter by hash/number object)no_eip2718: Doesn’t returntypefield in receipts (pre-EIP-2718 chains)compression/<method>: Supports compression (gzip,brotli, ordeflate)- For Firehose:
compressionandfilters
headers: HTTP headers for every request. Default: nonelimit: Maximum subgraphs using this provider. Default: unlimitedtoken: Bearer token for Firehose providerskey: API key for Firehose providers
Provider Limits (Experimental)
Limit the number of subgraphs per provider using node name patterns:some_node_.* use mainnet-1 for at most 10 subgraphs, then fall back to mainnet-0. Nodes named other_node_.* never use mainnet-1.
At least one provider should be unlimited. If a node’s name doesn’t match any rule, that provider is disabled for that node.
Deployment Configuration
The[deployment] section controls where new subgraph deployments are placed, determining both the storage shard and indexing node.
Deployment Rules
Rules are evaluated in order. The first matching rule determines placement.Rule Matching
Thematch element can contain:
name: Regular expression matched against subgraph namenetwork: String or list of strings compared to deployment’s network
Rule Actions
shard: Storage shard name (default:primary)shards: List of shards (system chooses the one with fewest active deployments)indexers: List of indexing nodes (deployment spreads evenly across listed nodes)
Indexer names must match the
--node-id values used when starting index nodes.Query Nodes
Configure nodes as query-only (no indexing) by adding to[general]:
--node-id matching the regex will:
- Only respond to queries
- Not connect to configured blockchain providers
- Not perform any indexing
Configuration Validation
Validate configuration file syntax and consistency:- Syntax errors
- Internal inconsistencies
- Undeclared shards referenced in deployment rules
- Invalid configuration combinations
Simulating Deployment Placement
Test where a subgraph would be deployed without making changes:- Database shard for subgraph data
- List of potential indexing nodes
- Selection logic (node with fewest current subgraphs)
Complete Example
Full Production Configuration
Full Production Configuration

