Building Graph Node from source is typically needed for contributors or developers who want to modify Graph Node itself. For subgraph development, using Docker is recommended.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/graphprotocol/graph-node/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Ensure the following are installed on your system:PostgreSQL 12 or higher
- macOS: Postgres.app (recommended)
- Linux: Use your distribution’s package manager
- Windows: PostgreSQL Downloads
IPFS daemon (Kubo)Install IPFS
Protocol Buffers compiler
- macOS:
brew install protobuf - Linux:
apt-get install protobuf-compilerordnf install protobuf-compiler - Manual: Installing Protobuf
Access to an Ethereum RPC endpointOptions:
- Local node (Geth, Erigon, Nethermind)
- Provider service (Infura, Alchemy, QuickNode)
Setup Instructions
Install Rust Components
Ensure all required Rust components are installed:The
graph-node codebase assumes the latest available stable compiler is used.Set Up PostgreSQL
Create a database and configure it for Graph Node.
Create Database and User
Create Database and User
The superuser name depends on your installation (usually Required PostgreSQL extensions:
postgres or your username):- pg_trgm: Trigram matching for text search
- btree_gist: B-tree indexing support
- postgres_fdw: Foreign data wrapper for multi-database setups
Set Connection String
Set Connection String
Set the Verify the connection:
POSTGRES_URL environment variable and save it (e.g., in ~/.bashrc or ~/.zshrc):Build Graph Node
Build the Graph Node binary in release mode:This compiles the
graph-node binary to target/release/graph-node.Build Time and Resources
Build Time and Resources
Initial builds can take 15-30 minutes depending on your system. Ensure you have:
- At least 8GB RAM
- 10GB free disk space
- Good internet connection for downloading dependencies
Run Graph Node
Start Graph Node with the required configuration:
Ethereum RPC Format
Ethereum RPC Format
The Examples:Common Capabilities:
--ethereum-rpc argument format is:archive: Full historical state availabletraces: Supports debug_traceBlockByNumber for call tracing
Verify Graph Node is Running
Graph Node prints the ports it’s listening on when it starts. By default:
- GraphQL HTTP: http://localhost:8000
- GraphQL WebSocket: ws://localhost:8001
- JSON-RPC Admin: http://localhost:8020
- Indexing Status: http://localhost:8030
Deploying a Subgraph
Once Graph Node is running, deploy subgraphs using Graph CLI:Development Workflow
Running Tests
Code Quality
Building Specific Components
Command Line Arguments
PostgreSQL connection stringFormat:
postgresql://user:password@host:port/databaseEthereum network configurationFormat:
NETWORK:[CAPABILITIES]:URLCan be specified multiple times for multiple networks.IPFS node addressDefault:
127.0.0.1:5001Unique identifier for this node (for multi-node setups)Default:
defaultPath to TOML configuration file for advanced setupsMutually exclusive with
--postgres-url and --ethereum-rpcEnable debug logging
Advanced Configuration
For complex deployments, use a TOML configuration file instead of command-line arguments:- Multiple PostgreSQL databases (sharding)
- Multiple blockchain networks
- Advanced indexing and query node separation
- Custom deployment rules
Environment Variables
Many aspects of Graph Node can be configured via environment variables:System Requirements
Minimum Requirements
- CPU: 4 cores
- RAM: 8GB
- Disk: 50GB SSD (more for indexing mainnet)
- Network: Stable broadband connection
Recommended for Production
- CPU: 16+ cores
- RAM: 32GB+
- Disk: 500GB+ NVMe SSD
- Network: 1Gbps connection
- PostgreSQL: Dedicated database server with tuning
Troubleshooting
Compilation errors
Compilation errors
Ensure you have the latest stable Rust:Install system dependencies:
PostgreSQL connection failures
PostgreSQL connection failures
Verify the connection string:Check PostgreSQL is running:Ensure required extensions are installed:
IPFS connection errors
IPFS connection errors
Verify IPFS is running:Check IPFS configuration:
Out of memory during compilation
Out of memory during compilation
Reduce parallel compilation jobs:Or build without release optimizations initially:
Ethereum RPC errors
Ethereum RPC errors
Test your Ethereum endpoint:Ensure your RPC provider supports required methods:
eth_getLogseth_getBlockByNumbereth_calldebug_traceBlockByNumber(for traces)
GraphMan CLI Tool
Graph Node includesgraphman, a CLI tool for database management:
Next Steps
- Environment Variables - Tune performance and behavior
- Configuration Overview - Advanced TOML configuration
- Docker Setup - Alternative deployment method
- Contributing Guide - Contribute to Graph Node

