Snapshot

A snapshot records the Fork's blockchain status, including simulated transactions, deployed contracts, etc. Our system allows users to create multiple snapshots in the Fork and quickly switch between different snapshots.

The snapshot feature is particularly useful in the following two scenarios:

  • When a user wants to run a testing script multiple times, he/she can revert to the original snapshot and rerun the script

  • When a user wants to save some states and return to them later, he/she can create a snapshot and then revert to this snapshot later.

Create a Snapshot

A user can create a snapshot from the Fork menu. A default snapshot for a Fork (with empty transactions from the forked blockchain states) is also available.

Click Add Snapshot in the apps inside a Fork to create a snapshot from the current block number. This snapshot includes all the simulated transactions and deployed contracts.

Snapshots List

Click on Snapshots to see the list of snapshots.

When a user wants to switch to a snapshot, click the Revert to this Snapshot button to revert to the snapshot.

Before reverting to a snapshot, remember to create a new snapshot to save the current state if the user wants to revert to it later. Otherwise, all the simulated transactions and deployed contracts will be lost!

The Init snapshot is the default snapshot, i.e., the saved status when creating this fork. Users can revert to this snapshot if they want a clean Fork status.

API Access

The RPC method evm_snapshot and evm_revert can be used to create and revert to a snapshot inside a Fork.

Last updated