Skip to main content
Graph Node behavior can be extensively configured through environment variables. This reference documents all available variables organized by category.
Some environment variable names may change in future releases. Always check the latest documentation when upgrading.

General Settings

string
default:"default"
Unique identifier for this Graph Node instanceRequired when running multiple nodes in parallel. Each node must have a unique ID. The same node should use the same ID across restarts.
boolean
Use literal node_id value in Docker without replacing hyphens with underscoresDocker only. Changing this for an existing installation requires updating node_id values in subgraphs.subgraph_deployment_assignment table.
string
default:"info"
Graph Node logging configurationUses same syntax as Rust’s env_logger.
Levels: error, warn, info, debug, trace
string
default:"%b %d %H:%M:%S%.3f"
Custom log timestamp formatUses chrono format syntax.
string
Enable detailed query timing logsComma-separated list: sql, gql, cache
  • gql: Log GraphQL queries with timing, subgraph, variables, and unique query_id
  • sql: Log SQL queries with timing, bind variables, and entity counts
  • cache: Log cache hits/misses for GraphQL queries
boolean
Log Proof of Indexing events deterministicallyUseful for debugging POI-related issues.
boolean
Kill the process if it becomes unresponsiveSet to any value to enable.
number
default:"10"
Timeout in seconds before killing unresponsive nodeOnly used if GRAPH_KILL_IF_UNRESPONSIVE is set.

Ethereum / EVM Chain Configuration

number
default:"250"
Maximum expected reorg size in blocksIf a larger reorg occurs, subgraphs may process inconsistent data.
number
default:"500"
How often to poll Ethereum for new blocks (milliseconds)
number
default:"100"
Target number of triggers to process per batchToo small: Excessive requests to Ethereum node Too large: Expensive calls and high memory usage
number
default:"50"
Number of blocks to scan per RPC request when fetching tracesUsed for call handlers and block handlers with call filters.
number
default:"10"
Number of Ethereum blocks to request in parallelAlso limits parallel requests like trace_filter.
number
default:"1000"
Maximum block range to scan for triggers in each request
number
default:"500"
Maximum range for eth_getLogs requests filtering only by event signature (not contract address)
duration
Timeout for Ethereum JSON-RPC requests
number
default:"10"
Number of retries for Ethereum JSON-RPC requestsFor requests that won’t fail the subgraph but will restart syncing (e.g., requesting a reorged block).
number
default:"1000"
Maximum concurrent requests for transaction receipts during block ingestion
boolean
Fetch transaction receipts in batches instead of concurrentlyAutomatically set to true on macOS to avoid DNS issues.
boolean
Clean up unneeded blocks from the cacheDevelopment only. In production, causes multiple downloads of the same blocks. Cannot be used with multiple shards.
number
default:"0"
Specify genesis block number
number
default:"2000"
Maximum number of contracts to query in a single eth_getLogs request
number
default:"10"
Timeout (seconds) for checking eth_getBlockReceipts supportIf timeout occurs, individual transaction receipts are fetched instead.
boolean
Disable block ingestionSet to true to disable, false or unset to enable.

Firehose Configuration

string
default:"25MB"
Maximum size of a message that can be decoded by Firehose

Mapping Handlers

number
Maximum execution time for a mapping handler (seconds)Default: unlimited
number
default:"10000"
Entity cache size in kilobytesDefault is 10MB.
string
default:"0.0.7"
Maximum supported apiVersion in subgraph manifestsSubgraphs with higher versions will be rejected.
string
default:"0.0.5"
Maximum supported specVersion in subgraph manifestsSubgraphs with higher versions will be rejected.
string
default:"512KiB"
Maximum WASM runtime stack sizeExecution stops with an error if exceeded.

IPFS Configuration

number
default:"60"
Timeout for IPFS requests (seconds)Includes manifest files and ipfs.cat calls from mappings.
number
default:"26214400"
Maximum file size for ipfs.cat calls (bytes)Default: 25 MiBAffects both subgraph files and file data sources.
number
default:"268435456"
Maximum file size for ipfs.map (bytes)Default: 256 MBEntities from ipfs.map are kept in memory during processing.
number
default:"50"
Maximum number of files to cache from IPFS
number
default:"1048576"
Maximum size of each cached IPFS file (bytes)Default: 1 MiB
number
default:"100"
Rate limit for IPFS file data source requests (per second)
number
default:"100000"
Maximum retry attempts for IPFS requestsPrevents infinite retries on file not found or other errors.
string
File or Redis cache location for IPFS filesExperimental. Can be:
  • redis://host:port - Redis cache
  • /path/to/directory - Filesystem cache (must be writable)
boolean
Enable ipfs.cat in subgraph mappingsExperimental and non-deterministic. Will be removed in future versions.

GraphQL Configuration

number
Maximum GraphQL query execution time (seconds)Default: unlimited
number
Maximum GraphQL query complexityDefault: unlimitedIntrospection queries have complexity ~1 million. Set higher than that to allow introspection.
number
default:"255"
Maximum GraphQL query depthMaximum allowed: 255
number
default:"1000"
Maximum value for first argument in queries
number
Maximum value for skip argument in queriesDefault: unlimited
number
Log warning if GraphQL result exceeds this size (bytes)Default: unlimited
number
Return error if GraphQL result exceeds this size (bytes)Default: unlimitedChecked during response construction to prevent excessive memory use.
number
default:"8000"
Port for GraphQL HTTP server
number
Maximum SQL query execution time during GraphQL execution (seconds)Default: unlimited
boolean
default:"false"
Enable GraphQL specification validationsValidates queries follow GraphQL execution rules.
boolean
default:"true"
Only log GraphQL validation errors without failing queriesOnly used if ENABLE_GRAPHQL_VALIDATIONS=true.Queries may still fail during execution stage.
boolean
Disable AND/OR filters for performanceUseful if complex filters cause performance issues.
boolean
Disable child-based sorting for performanceUseful if child sorting causes performance issues.
string
Token to enable query tracingRequests with X-GraphTraceQuery header matching this token will include SQL query traces.
Then in requests:

GraphQL Query Caching

string
default:"*"
Subgraphs to cache queries for
  • *: Cache all subgraphs (default)
  • Comma-separated list: Cache specific subgraphs
number
default:"1"
Number of recent blocks per network to keep in query cacheSet to 0 to disable caching. Keep small as lookup time and memory are proportional to this value.
number
default:"1000"
Maximum memory for query cache (MB)Default: 1 GBTotal cache memory is 2x this value (recent blocks + frequent queries).
number
default:"100"
Number of queries after which a cache entry can be considered stale
number
default:"3"
Maximum cache entry size ratioResults larger than (cache shard size / ratio) won’t be cached.Set to 0 for no limit.

Database Configuration

number
default:"10"
Database connection pool sizeMay not be strictly adhered to due to implementation details.
number
default:"5000"
Database connection timeout (milliseconds)If exceeded, database is assumed down.
number
default:"30000"
Database setup operation timeout (milliseconds)Default: 30 secondsUsed for migrations and schema creation, which may take longer than normal operations.
number
default:"2"
Probe interval when database shard is unavailable (seconds)Only one request per interval attempts connection; others fail instantly.
string
PostgreSQL URL for running testsFormat: postgresql://user:password@host:port/database
number
default:"180"
Target duration for batch operations during copying/grafting (seconds)Controls transaction length for long-running operations.
number
Maximum batch operation timeout (seconds)Default: unlimitedShould be a small multiple (e.g., 10x) of GRAPH_STORE_BATCH_TARGET_DURATION.If hit, batch size resets to 1 and retries.
number
default:"1"
Number of parallel workers for batch operationsMinimum: 1Uses idle connections to copy tables in parallel during subgraph copy operations.
number
default:"300"
How long to accumulate changes before writing (seconds)Set to 0 to disable write batching.
number
default:"10000"
How many changes to accumulate before writing (kilobytes)Default: 10 MBSet to 0 to disable write batching.
boolean
default:"false"
Disable storing/reading eth_call results from cacheUseful for indexers running their own RPC nodes. May significantly impact performance depending on eth_call execution time vs database lookup cost.
boolean
Postpone creating attribute-based indexes during subgraph copyCan speed up syncing.
number
default:"0"
Workaround for ‘too many parameters’ PostgreSQL errorsIf encountering “number of parameters must be between 0 and 65535” errors, set to ~10.Such errors are always Graph Node bugs; this provides a temporary workaround.

Database Pruning and History

number
default:"1.2"
History accumulation threshold before pruningMinimum: 1.01At 1.2, subgraph is pruned when it contains 20% more history than its limit.
number
default:"0.5"
Prune by copying entities to new tables if removing more than this fractionMust be between 0 and 1, and greater than DELETE_THRESHOLD.
number
default:"0.05"
Prune by deleting from existing tables if removing between this and REBUILD_THRESHOLDMust be between 0 and 1, and less than REBUILD_THRESHOLD.If removing less than this threshold, no pruning occurs.
number
Minimum blocks to retain for subgraphs with historyBlocks: autoDefault: 2 × reorg threshold
number
default:"360"
How long to wait before removing unused deployments (minutes)Default: 6 hoursGraph Node periodically marks unused deployments, then waits this interval before deletion.

Experimental Database Features

boolean
default:"false"
Enable experimental SQL query interface
number
Interval for account-like optimization scan (hours)Requires also setting:
  • GRAPH_STORE_ACCOUNT_LIKE_MIN_VERSIONS_COUNT
  • GRAPH_STORE_ACCOUNT_LIKE_MAX_UNIQUE_RATIO
Scans for tables that benefit from account-like optimization.Reads from info.table_stats materialized view (refreshes every 6 hours).
number
Minimum total versions for account-like flaggingRequired for account-like optimization scan.
number
Maximum unique entities to version ratioExample: 0.01 ≈ 1:100 entity-to-version ratioRequired for account-like optimization scan.

Load Management

number
default:"300"
Load measurement window size (seconds)Used with GRAPH_LOAD_BIN_SIZE for load throttling.
number
default:"1"
Load measurement bin size (seconds)Measurements within window are binned into intervals of this size.
number
default:"0"
Database connection wait time threshold for throttling (milliseconds)Default: 0 (throttling disabled)If connection wait times exceed this, queries are throttled until wait times drop below threshold.
number
Effort fraction threshold for permanently rejecting queriesWhen overloaded, queries causing more than this fraction of effort are permanently rejected (even after overload resolves).If unset, no queries are jailed (but still subject to throttling).
boolean
default:"false"
Simulate load management without declining queriesPerforms all load management steps but only logs decisions instead of rejecting queries.

Subgraph Features

string
default:"instant"
Subgraph version switching behavior
  • instant: Switch immediately when new version deployed
  • synced: Only switch after new deployment syncs (becomes “Pending” version)
string
Starting block for forked subgraphFormat: block_hash:block_number
string
API URL for subgraph forking
string
IPFS hash of subgraph to fork

Example Configurations

Development Environment

Production Environment

Query Node

Index Node

Next Steps