Catalog
fauziyasin-s2m4qw/erigon-datadir

fauziyasin-s2m4qw

erigon-datadir

Reference for manipulating Erigon datadirs. Use this when the user wants to perform operations on Erigon data directories.

v1.0LATEST
NewUpdated Aug 20, 2026

Erigon Datadir Operations

Duplicating a Datadir

Given a source path and destination path, follow this procedure exactly.

Precondition Checks

All checks must pass before copying. Abort on the first failure.

  1. Source exists: test -d <src> — abort if missing
  2. Source is a valid Erigon datadir: verify all three exist:
    • <src>/nodekey (file)
    • <src>/snapshots/ (directory)
    • <src>/chaindata/ (directory)
  3. Destination does not exist: test ! -e <dst> — abort if it already exists
  4. Destination parent is writable: test -w "$(dirname <dst>)" — abort if not
  5. Report source size: run du -sh <src> and always tell the user the size before proceeding
  6. Detect APFS: find the mount device for the destination parent directory from mount output. If the mount entry contains apfs, use the APFS CoW procedure below; otherwise use the full-copy procedure.

APFS Procedure (copy-on-write)

Use this when the destination is on an APFS volume.

  1. Run cp -ac <src> <dst> — this creates a CoW clone that is near-instant and consumes no extra disk space.
  2. No disk space check is needed for CoW clones.
  3. After the copy completes, delete chaindata from the destination: rm -rf <dst>/chaindata

Other Filesystems Procedure (full copy)

Use this when the destination is NOT on APFS.

  1. Check disk space: run df -h "$(dirname <dst>)" and compare available space to the source size. If available space is less than source size, abort and tell the user — do not proceed.
  2. Run cp -a <src> <dst> to recursively copy the entire datadir. This is a long-running operation for large datadirs — run in background.

Post-Copy

After either procedure completes, confirm success by listing the destination contents and comparing against the source (minus chaindata/ for APFS copies).

Overall Score

82/100

Grade

B

Good

Grades are signals, not a certification. Always review a skill yourself before use.

Safety

80

Quality

85

Clarity

82

Completeness

78

Summary

This skill provides reference guidance for manipulating Erigon blockchain node datadirs, specifically for duplicating a datadir from a source to a destination path. It documents precondition checks, two alternative copy procedures (one optimized for APFS volumes using copy-on-write, one for other filesystems), and post-copy verification steps.

Static Analysis Findings

1 finding

Patterns detected by deterministic static analysis before AI scoring. Hover over any finding code for detailed information and remediation guidance.

Destructive Operation
SEC-001Recursive DeletionMax: B

Recursive deletion pattern (rm -rf)

SKILL.mdrm -rf

Detected Capabilities

file writefile readdirectory operationsshell executionfilesystem introspectiondisk space checking

Trigger Keywords

Phrases that agents use to match this skill to user intent.

duplicate erigon datadirclone blockchain node dataapfs copy-on-write clonebackup erigon statemigrate blockchain datadirerigon node backup

Risk Signals

WARNING

Recursive deletion (rm -rf <dst>/chaindata)

SKILL.md | APFS Procedure, step 3
INFO

Full directory copy (cp -a) of potentially large datadirs without size validation on APFS path

SKILL.md | APFS Procedure, step 1

Use Cases

  • Clone a blockchain node datadir while preserving essential configuration and chaindata state
  • Migrate Erigon data from one storage device to another with filesystem-aware optimization
  • Back up an Erigon datadir before making modifications, using CoW cloning on APFS for efficiency
  • Verify datadir integrity after copying by comparing source and destination structure

Quality Notes

  • Excellent precondition documentation — all checks are explicit and must pass in order
  • Clear separation of two distinct procedures (APFS vs. other filesystems) with well-justified rationale
  • Helpful user communication requirements (report size before proceeding, abort with explanation on space shortage)
  • Includes filesystem detection logic to choose the optimal copy method automatically
  • Post-copy verification step ensures data integrity without relying on silent success
  • Good defensive programming: checks destination parent writability, confirms no pre-existing destination
  • Skill is self-contained and requires no external tools beyond standard Unix utilities
Model: claude-haiku-4-5-20251001Analyzed: Aug 20, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Use fauziyasin-s2m4qw/erigon-datadir in your dev environment

Command Palette

Search for a command to run...