Getting Started
Graphman is included in the official Graph Node containers. You can access it by running:Environment Variables
Graphman respects theGRAPH_LOG environment variable for logging output. To disable logs:
Verifying Setup
Test that graphman is configured correctly:Core Commands
Info
Prints detailed information about a deployment. Synopsis:<DEPLOYMENT>- The deployment identifier (subgraph name, IPFS hashQm.., or database namespacesgdNNN)
-c, --current- List only current version-p, --pending- List only pending versions-u, --used- List only used (current and pending) versions-s, --status- Include status information
- name - The subgraph name
- status - Either
pendingorcurrent - id - The
Qm...IPFS identifier - namespace - Database schema containing deployment tables
- shard - Database shard location
- active - Whether this version is used for queries
- chain - The blockchain network
- graph node id - The assigned node instance
--status enabled, additional fields include:
- synced - Whether synced to current chain head
- health -
healthy,unhealthy, orfailed - latest indexed block - Most recent processed block
- current chain head block - Latest blockchain block
Query by name
Query by name
Query by IPFS hash
Query by IPFS hash
Query with status information
Query with status information
Remove
Removes the association between a subgraph name and its deployment. Synopsis:<NAME>- The name of the subgraph to remove
Unassign
Stops Graph Node from indexing a deployment permanently. Synopsis:<DEPLOYMENT>- The deployment identifier
Unassign by name
Unassign by name
Unassign by IPFS hash
Unassign by IPFS hash
Drop
Completely deletes a deployment and all its indexed data. Synopsis:<DEPLOYMENT>- The deployment identifier
-c, --current- Search only for current versions-p, --pending- Search only for pending versions-u, --used- Search only for used versions-f, --force- Skip confirmation prompt
Drop by deployment ID
Drop by deployment ID
Drop by subgraph name
Drop by subgraph name
Cleanup Commands
Unused Record
Scans all shards for unused deployments and registers them for removal. Synopsis:- Not assigned to any node
- Either not marked as active, or neither current nor pending version of a subgraph
- Not the source of a currently running copy operation
unused_deployments table in the primary shard.
Unused Remove
Deletes deployments previously marked as unused. Synopsis:-c, --count <COUNT>- How many unused deployments to remove (default: all)-d, --deployment <DEPLOYMENT>- Remove a specific deployment-o, --older <OLDER>- Remove only deployments recorded at least this many minutes ago
Remove all unused deployments
Remove all unused deployments
Remove deployments older than 12 hours
Remove deployments older than 12 hours
Remove specific deployment
Remove specific deployment
Chain Management
Check Blocks
Validates cached blocks against fresh data from the JSON RPC provider. Synopsis:<chain-name>- Chain name (must be configured in your config file)
by-hash <hash>- Check a single block by hashby-number <number>- Check a single block by numberby-range [--from <n>] [--to <n>]- Check a range of blocks
--delete-duplicates- Automatically remove duplicate blocks at the same height
--delete-duplicates is specified, which removes all duplicates for that block number.
Examples:
Check single block by hash
Check single block by hash
Check single block by number
Check single block by number
Check block range with duplicate removal
Check block range with duplicate removal
Check all blocks after specific height
Check all blocks after specific height
Call Cache Remove
Removes call cache entries for a specified chain. Synopsis:--from <FROM>- Starting block number--to <TO>- Ending block number--remove-entire-cache- Remove the complete cache--ttl-days <TTL_DAYS>- Remove contracts not accessed for this many days--ttl-max-contracts <MAX>- Limit number of contracts removed with TTL
--from and --to:
- Omitting
--fromstarts from the first cached block - Omitting
--toextends to the last cached block
--ttl-days option removes stale contracts based on the call_meta.accessed_at field. For example, --ttl-days 7 removes all calls to contracts not accessed in the last 7 days.
Use --ttl-max-contracts to limit how many contracts are removed in a single operation.
Examples:
Remove cache for block range
Remove cache for block range
Remove entire cache
Remove entire cache
Remove stale contracts (7 days)
Remove stale contracts (7 days)
Remove stale contracts with limit
Remove stale contracts with limit
Workflow Examples
Typical Cleanup Workflow
When you need to free up disk space by removing old deployments:Migrating a Deployment
To stop serving a subgraph and free its name for a new version:Best Practices
Always test graphman commands
Always test graphman commands
drop or unused remove, use info and unused list to verify which deployments will be affected.Use --force carefully
Use --force carefully
--force flag skips confirmation prompts. Only use it in automated scripts after thorough testing.Wait before removing unused deployments
Wait before removing unused deployments
--older with unused remove to ensure deployments have been unused for a safe period (e.g., 24 hours) before deletion.Monitor block cache health
Monitor block cache health
check-blocks on critical block ranges to ensure data integrity, especially after RPC provider changes.Clean call cache strategically
Clean call cache strategically
Troubleshooting
Graphman can’t connect to database
Ensure your config file has correct database connection strings and that the database is accessible from the container.Deployment not found
Verify the deployment identifier using:Check-blocks finds mismatches
This indicates your RPC provider sent incorrect data. The command automatically removes bad cached blocks. Consider switching to a more reliable RPC provider.Unused remove doesn’t delete a deployment
Ensure the deployment was marked as unused withgraphman unused record first. Check that it’s not currently assigned to a node.
