Skip to content

Instantly share code, notes, and snippets.

@anacrolix
Created July 18, 2025 03:49
Show Gist options
  • Save anacrolix/ca3e13b6a183a913cc1520122ff1c243 to your computer and use it in GitHub Desktop.
Save anacrolix/ca3e13b6a183a913cc1520122ff1c243 to your computer and use it in GitHub Desktop.

How to use the snapshot reset tool:

erigon snapshots reset

See the options:

   --chain value                  name of the network to join
   --datadir value                Data directory for the databases (default: /Users/anacrolix/Library/Erigon)
   --help, -h                     show help
   --verbosity value              Set the log level for console logs (default: "info")

   Reset

   --chaindata, -c       Remove chaindata too. (default: false)
   --dry-run, -n         Print files that would be removed, but do not remove them. (default: false)
   --remove-unknown, -u  Remove files not described in snapshot set. (default: false)

The chain is inferred from chaindata if it still exists in your datadir. If it doesn't you must specify the chain.

Unknown files are local files that don't exist in the preverified snapshot hashes. If this is not specified, only files torrent files that don't match the hash will be removed.

Run with --verbosity=5 to see plenty of information about what it's doing.

Run with -c -u to nuke your datadir all the way back to just the files expected to be in an initial sync. When you run Erigon next, the initial sync will ensure the data files are correct. You must sync before you can expect the data files to be corrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment