Skip to main content
Graphman is the command-line administration tool for Graph Node. It provides commands to manage deployments, inspect their status, and maintain the indexing infrastructure.

Usage

All Graphman commands follow this pattern:
string
required
Path to the Graph Node configuration file (typically config.toml)

Commands Overview

Info

Display deployment details and status

Remove

Remove a named subgraph

Unassign

Stop indexing a deployment

Drop

Delete deployment and all data

Unused Record

Record unused deployments

Unused Remove

Remove recorded unused deployments

Check Blocks

Verify cached block integrity

Call Cache Remove

Clear chain call cache

Info

Prints detailed information about a deployment, including its status, location, and indexing progress.

Usage

Arguments

string
required
The deployment identifier. Can be specified as:
  • Subgraph name: author/subgraph-name
  • IPFS hash: QmfWRZCjT8pri4Amey3e3mb2Bga75Vuh2fPYyNVnmPYL66
  • Database namespace: sgdNNN
  • IPFS hash with shard: Qm...:shard (when the same hash is deployed in multiple shards)

Options

boolean
List only current version
boolean
List only pending versions
boolean
List only used (current and pending) versions
boolean
Include detailed status information (sync status, health, block numbers)

Output Fields

By default, the command displays:
  • name - The subgraph name
  • status - Either pending or current
  • id - The IPFS hash (Qm… identifier)
  • namespace - Database schema containing deployment data tables
  • shard - Database shard location
  • active - Whether this is the active version for querying
  • chain - Blockchain network name
  • graph node id - Node ID assigned to this deployment
With --status flag, additional fields are shown:
  • synced - Whether the subgraph has synced to the current chain head
  • health - Can be healthy, unhealthy (syncing with errors), or failed
  • latest indexed block - Most recent block processed
  • current chain head block - Current blockchain head

Examples


Remove

Removes the association between a subgraph name and its deployment. This stops query traffic to the named subgraph and releases the name for reuse.
No indexed data is lost. This command only removes the name mapping.

Usage

Arguments

string
required
The name of the subgraph to remove (e.g., author/subgraph-name)

Examples

Use Cases

  • Stop serving queries for a specific subgraph name
  • Release a subgraph name for another deployment
  • Temporarily disable a subgraph without losing data

Unassign

Makes Graph Node stop indexing a deployment permanently. The deployment is removed from all node assignments.
No indexed data is lost. The deployment data remains in the database but is no longer actively indexed.

Usage

Arguments

string
required
The deployment identifier (see info command for supported formats)

Examples

Refer to the Maintenance Documentation for more details about deployment assignment management.

Unused Record

Inspects all shards for unused deployments and registers them in the unused_deployments table. This is the first step before removing unused deployment data.
No indexed data is lost. This command only records which deployments are unused.

Usage

Unused Deployment Criteria

A deployment is considered unused if it meets ALL of these criteria:
  1. Not assigned to any node
  2. Either not marked as active OR is neither the current nor pending version of a subgraph
  3. Not the source of a currently running copy operation

Examples

Workflow

This command is typically followed by unused remove to actually delete the recorded unused deployments:

Unused Remove

Removes all indexed data from deployments previously marked as unused by the unused record command.
This operation is irreversible. All data from the selected deployments will be permanently deleted.

Usage

Options

number
Maximum number of unused deployments to remove (default: all)
string
Remove a specific deployment by its identifier
number
Remove only deployments recorded at least this many minutes ago

Removal Order

Deployments are removed in descending order by number of entities (smaller deployments first, larger ones last).

Examples


Drop

Stops, unassigns, and deletes all indexed data from a deployment in a single operation.
This operation is irreversible. The deployment will be completely removed with all its data.

Usage

Arguments

string
required
The deployment identifier (name, IPFS hash, or namespace)

Options

boolean
Search only for current versions
boolean
Search only for pending versions
boolean
Search only for used (current and pending) versions
boolean
Skip confirmation prompt

What It Does

The drop command is equivalent to running these commands in sequence:
  1. graphman info <search term>
  2. graphman unassign <deployment id>
  3. graphman remove <deployment name>
  4. graphman unused record
  5. graphman unused remove <deployment id>

Examples


Check Blocks

Compares cached blocks with fresh data from the JSON RPC provider and clears any blocks that differ. This helps diagnose and fix issues with invalid block data from RPC providers.

Usage

Arguments

string
required
Chain name (must be an existing chain, see chain list)

Subcommands

Check a specific block by its hash.
string
required
The block hash (e.g., 0xd56a9f64c7e696cfeb337791a7f4a9e81841aaf4fcad69f9bf2b2e50ad72b972)

Handling Duplicates

JSON RPC providers may sometimes return different blocks for the same block number. When this happens, Graphman cannot automatically determine which is correct and will abort unless you specify --delete-duplicates, which removes all duplicated blocks before proceeding.

Examples


Call Cache Remove

Removes entries from the chain call cache. The call cache stores results of contract calls to improve indexing performance.
Removing the entire cache can significantly reduce indexing performance and should generally be avoided.

Usage

Arguments

string
required
The name of the chain

Options

boolean
Remove the entire call cache for the chain
number
Remove stale contracts not accessed in this many days (based on call_meta.accessed_at)
number
Limit the number of contracts to consider for stale removal
number
Starting block number for range-based removal
number
Ending block number for range-based removal

Removal Strategies

Remove cache entries for a specific block range:
If --from is omitted, starts from the first block. If --to is omitted, continues to the last block.
Remove cache entries for contracts that haven’t been accessed recently:
Remove the entire call cache:
Use with caution: This will significantly impact indexing performance.

Examples


Best Practices

Always Use --config

Always specify the configuration file path with --config to ensure commands operate on the correct Graph Node instance.

Verify Before Dropping

Use info command to verify deployment details before running destructive operations like drop.

Two-Step Cleanup

Use unused record followed by unused remove instead of immediately dropping deployments. This gives you time to verify.

Monitor Block Cache

Regularly use check-blocks to ensure RPC provider data integrity, especially after RPC provider changes.

See Also