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.zipInstalls 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.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
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
- Erigon must be stopped - The command requires exclusive access to the datadir
- Binary must be built - Run
/erigon-buildfirst if the binary doesn't exist - 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:
- Build Missing Indices - Creates any missing indices for block and Caplin snapshots
- Retire Blocks - Freezes blocks from the database into snapshot files
- Remove Overlaps - Cleans up overlapping snapshot files
- Prune Ancient Blocks - Removes block data from the database that has been successfully snapshotted
- Build State History - Creates missing accessors and builds state history snapshot files
- Prune State History - Removes state history that has been snapshotted
- 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:
- Shutdown Erigon
- Run
seg retire(this command) - Optionally run
seg clearIndexing - Run
seg index - Create torrent files
- Run integrity check
- Run
publishablecommand
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
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| erigon-seg-retire (this skill) | 2 | 6mo | Review | Advanced |
| applescript | 28 | 8mo | Review | Advanced |
| bazel-build-optimization | 14 | 2mo | No flags | Advanced |
| home-assistant-manager | 9 | 8mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by erigontech
View all by erigontech →You might also like
applescript
martinholovsky
Expert in AppleScript and JavaScript for Automation (JXA) for macOS system scripting. Specializes in secure script execution, application automation, and system integration. HIGH-RISK skill due to shell command execution and system-wide control capabilities.
bazel-build-optimization
wshobson
Optimize Bazel builds for large-scale monorepos. Use when configuring Bazel, implementing remote execution, or optimizing build performance for enterprise codebases.
home-assistant-manager
komal-SkyNET
Expert-level Home Assistant configuration management with efficient deployment workflows (git and rapid scp iteration), remote CLI access via SSH and hass-cli, automation verification protocols, log analysis, reload vs restart optimization, and comprehensive Lovelace dashboard management for tablet-optimized UIs. Includes template patterns, card types, debugging strategies, and real-world examples.
swarm-advanced
ruvnet
Advanced swarm orchestration patterns for research, development, testing, and complex distributed workflows
windows-expert
jackspace
Expert guidance for Windows, PowerShell, WSL interop, and cross-platform development
bash-linux
davila7
Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS or Linux systems.