Automated summary
Runs the `erigon seg retire` command to build, merge and clean snapshot segment files in an Erigon datadir ahead of publication.
Strengths
- Precisely lists the seven sequential operations the command performs (indices, block retirement, overlap removal, ancient-block pruning, state history build, state history pruning, merge/cleanup)
- States explicit prerequisites: Erigon stopped, binary built, synced datadir present
- Places the command inside the full "Publishable v2" release workflow alongside adjacent commands
- Calls out practical friction points: file lock, long runtime, disk I/O intensity
Limitations
- Assumes the binary and datadir already exist and does not cover building or syncing them
- Gives no guidance on diagnosing, resuming or rolling back a failed run
- Provides no runtime or disk-space estimates for mainnet
Use it when a synced Erigon datadir must be prepared for snapshot publication.
Avoid it for routine node operation or when Erigon must stay online and serving queries.
Security analysis
CautionThe skill documents a legitimate Erigon maintenance command and does not exfiltrate data, disable safety, or use obfuscated payloads. However, it grants Bash and directs a disk-intensive command that prunes database/state-history data, so it warrants caution rather than being considered risk-free.
- •Instructs Bash execution of `erigon seg retire`, which prunes and mutates blockchain datadir contents; an incorrect `--datadir` path could cause data loss.
- •Relies on prose-only prerequisites (Erigon stopped, correct datadir) with no validation or confirmation step.
Examples
Erigon is shut down on my node. Run seg retire against the datadir at /data/erigon so the snapshot files are ready to publish.`erigon seg retire --datadir=/data/erigon` failed with a file lock error — what should I check and in what order?Walk me through the complete publishable v2 snapshot release flow, starting from shutting down Erigon and including where seg retire fits.name: erigon-seg-retire description: Run the Erigon segment retire command to build, merge, and clean snapshot files. Use this for snapshot publication readiness preparation. allowed-tools: Bash, Read
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
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/erigon-segment-retire-command-mmh8qqhk/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/erigon-segment-retire-command-mmh8qqhk' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/erigon-segment-retire-command-mmh8qqhk/download' --output '.skill-downloads/erigon-segment-retire-command-mmh8qqhk/SKILL.md.part' && mv '.skill-downloads/erigon-segment-retire-command-mmh8qqhk/SKILL.md.part' '.skill-downloads/erigon-segment-retire-command-mmh8qqhk/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
Tools declared by the author (check availability in your agent): Bash, Read
Original excerpt: 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
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/erigon-segment-retire-command-mmh8qqhk/SKILL.md' && test -s '.skill-downloads/erigon-segment-retire-command-mmh8qqhk/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/erigon-seg-retire' && cp -R '.skill-downloads/erigon-segment-retire-command-mmh8qqhk' '.claude/skills/erigon-seg-retire'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/erigon-segment-retire-command-mmh8qqhk'openskills read 'erigon-segment-retire-command-mmh8qqhk'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/erigon-segment-retire-command-mmh8qqhk/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
Configure a Chat Channel with SecretRefs
DevOps
Set up chat channels using non-interactive commands, with secrets only as SecretRefs. Covers gather, mutate, repair, and prove steps for reliable delivery.
Investigate ClickHouse CI Failures
DevOps
Investigate a ClickHouse CI failure end-to-end from a PR or S3 report URL. Fetches failed tests, classifies flaky vs real regression, and checks for existing issues/fixes.
Ansible PR Review
DevOps
Reviews an Ansible PR following the project's standardized process, including changelog checks, test coverage validation, and feedback tracking.