erigon-datadir

Duplicates Erigon datadirs using APFS copy-on-write clones or full filesystem copies.

3.6k|1.5k|Updated May 27, 2019
One-click install
npx skills add https://github.com/erigontech/erigon --skill erigon-datadir
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: erigon-datadir
Source: https://github.com/erigontech/erigon/tree/main/.claude/skills/erigon-datadir
Command: npx skills add https://github.com/erigontech/erigon --skill erigon-datadir

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Duplicating an Erigon node datadir is risky and slow: datadirs can be hundreds of gigabytes, copies can fail due to insufficient disk space, and naive copying wastes storage when the filesystem supports copy-on-write. This Skill provides a safe, validated procedure for cloning Erigon datadirs.

Core Features & Use Cases

  • Precondition Validation: Verifies the source is a valid Erigon datadir (nodekey, snapshots/, chaindata/), the destination does not exist, and the destination parent is writable before copying.
  • APFS Copy-on-Write Cloning: Detects APFS mounts and uses cp -ac for near-instant clones that consume no extra disk space, then removes chaindata from the clone.
  • Full-Copy Fallback with Space Checks: On non-APFS filesystems, compares available disk space against source size and aborts before starting a doomed copy.
  • Use Case: You want to spin up a second Erigon node or test a risky operation on a copy of your node data. The Skill clones your existing datadir safely, choosing the fastest method for your filesystem.

Quick Start

Duplicate my Erigon datadir from /data/erigon to /backup/erigon-copy using the appropriate copy method for my filesystem.

Frequently Asked Questions about erigon-datadir

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I duplicate an Erigon datadir safely?

Verify the source contains nodekey, snapshots/, and chaindata/, confirm the destination does not exist, then copy with cp -a. On APFS volumes, cp -ac creates an instant copy-on-write clone; otherwise check free disk space against the source size first.

How to copy an Erigon datadir on macOS APFS without using extra disk space?

Use cp -ac on APFS to create a copy-on-write clone that shares storage blocks with the source and completes near-instantly. No disk space check is needed since the clone consumes no additional space until files diverge.

What makes a directory a valid Erigon datadir?

A valid Erigon datadir contains a nodekey file, a snapshots/ directory, and a chaindata/ directory. All three must exist before the directory should be treated as a duplicable Erigon datadir.

Why does copying an Erigon datadir fail partway through?

Copies typically fail because available disk space is smaller than the source datadir, which can be hundreds of gigabytes. Run df -h on the destination parent and du -sh on the source, and abort if free space is insufficient.

Can I delete chaindata from a cloned Erigon datadir?

Yes, chaindata can be removed from a clone since Erigon3 stores most data in immutable snapshot files and chaindata stays small. The APFS procedure deletes chaindata from the destination after cloning.