Skip to main content

Usage

Subcommands


save

Save the current chain state as a named snapshot.

Arguments

Flags

How It Works

  1. Calls evm_snapshot via JSON-RPC on the running chain
  2. Records the current block number and chain ID
  3. Saves metadata to ~/.dokrypt/snapshots/<project>/<name>.json

Examples


restore

Restore chain state to a previously saved snapshot.

Arguments

How It Works

  1. Loads the snapshot metadata
  2. Calls evm_revert with the snapshot ID
  3. Takes a new snapshot at the same point (EVM snapshots are consumed on revert)
  4. Returns the current block number

Examples

EVM snapshots are single-use — once reverted, the snapshot ID is consumed. Dokrypt automatically takes a new snapshot after restoring so you can restore again later.

list

List all snapshots for the current project.

Output

Snapshots are sorted by creation time (newest first).

delete

Delete a saved snapshot.

Examples


export

Export a snapshot to a JSON file for sharing or backup.

Arguments

How It Works

  1. Loads snapshot metadata
  2. Calls anvil_dumpState to export the full chain state
  3. Writes a JSON file containing both metadata and state data

Examples

The exported file contains:
anvil_dumpState is Anvil-specific. Export may not work with Hardhat or Geth chains.

import

Import a snapshot from a JSON file.

Arguments

How It Works

  1. Reads and parses the JSON file
  2. Loads the chain state via anvil_loadState
  3. Saves the metadata to the local snapshot registry

Examples


diff

Show differences between two snapshots.

Arguments

Output

Shows the block number delta and time difference between snapshots.

Examples