ER

erigon-seg-retire

Manages Erigon snapshot files by building indices, pruning data, and merging files for production readiness.

Install

mkdir -p .claude/skills/erigon-seg-retire && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4597" && unzip -o skill.zip -d .claude/skills/erigon-seg-retire && rm skill.zip

Installs to .claude/skills/erigon-seg-retire

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Run the Erigon segment retire command to build, merge, and clean snapshot files. Use this for snapshot publication readiness preparation.
137 chars✓ has a “when” trigger
Advanced

Key capabilities

  • Automated indexing of missing block snapshots
  • Freezing database blocks into snapshots
  • Removing ancient block data from live DB
  • Building state history accessors
  • Merging and cleaning snapshot file overlaps

How it works

Executes a multi-stage cleanup and serialization script that prunes cold data from the database and persists it into indexed snapshot segment files.

Inputs & outputs

You give it
Path to datadir
You get back
Optimized, index-verified snapshot files ready for release

When to use erigon-seg-retire

  • Prepare Erigon snapshots for public release
  • Clean up overlapping segment files
  • Prune ancient block data from the database
  • Build missing indices for block snapshots

About this skill

Erigon Segment Retire Command

The erigon seg retire command prepares snapshot files for publication by performing build, merge, and cleanup operations on segment files.

Prerequisites

  1. Erigon must be stopped - The command requires exclusive access to the datadir
  2. Binary must be built - Run /erigon-build first if the binary doesn't exist
  3. Datadir must exist - A synced Erigon datadir with blockchain data

Command

./build/bin/erigon seg retire --datadir=<path>

Replace <path> with the actual path to your Erigon data directory.

What the Command Does

The retire command performs these operations in sequence:

  1. Build Missing Indices - Creates any missing indices for block and Caplin snapshots
  2. Retire Blocks - Freezes blocks from the database into snapshot files
  3. Remove Overlaps - Cleans up overlapping snapshot files
  4. Prune Ancient Blocks - Removes block data from the database that has been successfully snapshotted
  5. Build State History - Creates missing accessors and builds state history snapshot files
  6. Prune State History - Removes state history that has been snapshotted
  7. Merge and Cleanup - Merges smaller snapshot files into larger ones and removes overlaps

Usage in Snapshot Release Workflow

This command is part of the "Publishable v2" snapshot release flow:

  1. Shutdown Erigon
  2. Run seg retire (this command)
  3. Optionally run seg clearIndexing
  4. Run seg index
  5. Create torrent files
  6. Run integrity check
  7. Run publishable command

Example

# Build the binary first (if needed)
make erigon

# Ensure Erigon is stopped, then run seg retire
./build/bin/erigon seg retire --datadir=/data/erigon

Important Notes

  • File Lock: If Erigon is running, the command will fail due to file lock
  • Long running: This command can take significant time on mainnet
  • Disk I/O intensive: Performs extensive read/write operations
  • Resource intensive: Designed to maximize resource utilization

When not to use it

  • While the Erigon node is actively running (requires lock)
  • If the datadir is corrupted
  • Quick testing environments without full history

Prerequisites

Erigon binaryStopped Erigon instance

Limitations

  • Blocks database access during execution
  • High storage overhead required during the merge phase
  • Processing time scales linearly with chain size

How it compares

It is an administrative utility specifically for preparing public-facing snapshot release artifacts rather than general node operation.

Compared to similar skills

erigon-seg-retire side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
erigon-seg-retire (this skill)26moReviewAdvanced
applescript288moReviewAdvanced
bazel-build-optimization142moNo flagsAdvanced
home-assistant-manager98moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry