Neutron Network Snapshots service
About snapshots service
The purpose of the snapshot service is to provide node operators and developers with snapshots of various types, ensuring that they have access to essential data for diverse applications and analyses on the Neutron Network chain. These snapshots are instrumental in facilitating efficient operations, comprehensive analyses, and the development of new features or forks. Each type of snapshot is tailored to meet specific needs, ensuring that both operators and developers can execute their tasks with precision and convenience.
The service offers two distinct types of snapshots: archived and raw. The archivedsnapshot is comprehensive, encompassing all historical data, which is crucial for in-depth analysis and research. This extensive archive enables the querying of all historical data, streamlining operations for node operators and analysts to gain insights and make informed decisions.
Conversely, the raw snapshot caters to the needs of developers looking to create network forks. Though not as expansive as the archived version, the raw snapshot provides real network data, ensuring that test environments closely replicate live conditions for accurate and reliable testing results. This type of snapshot is pivotal for the effective creation and management of testnets, promoting the development of new features and enhancements for the network.
For tools and resources related to the creation of network forks utilizing raw snapshots, interested parties can visit the project repository at
https://github.com/hadronlabs-org/rehearsal. This platform is dedicated to providing comprehensive resources and tools designed to facilitate the efficient creation and management of testnets. These resources are integral for developers aiming to enhance the network's functionality and performance through rigorous testing and development using real network data.
How to use
Install lz4 if needed.
$ sudo apt-get update
$ sudo apt-get -y install lz4
Before resetting the node you should stop it to avoid any potential data corruption.
$ sudo systemctl stop neutrond
Reset your node. Please be AWARE that resetting the node will result in the deletion of your node database. It is important to note that if you are currently running a validator, you should have previously backed up your "priv_validator_key.json" file before executing the reset command. Although the command itself does not erase the file, it is crucial to have a backup of it stored securely in a separate location.
$ neutrond tendermint unsafe-reset-all --home $HOME/.neutrond --keep-addr-book
As Neutron Network supports wasm and its "wasm" folder is located outside the data folder, our snapshot now includes the "wasm" folder. It's important to note that we have excluded the cache sub-folder from the snapshot to ensure compatibility with all CPUs. To ensure a clean start, please manually delete your "wasm" folder. Please be aware that using the "unsafe-reset-all" command does not reset the "wasm" folder, so manual deletion is necessary.
$ rm -r ~/.neutrond/wasm
To decompress the snapshot, you should extract its contents into your database location. Typically, the database location can be found at "~/.neutrond" or a similar path, depending on your specific node implementation. Please ensure that you decompress the snapshot into the appropriate database directory to successfully restore the snapshot's data.
curl -o - -L https://archive-data.neutron.org/neutron-1_16300822.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.neutrond
Before proceeding with the restart, it is essential to double-check the contents of the "
~/.neutrond/wasm" folder to ensure it is not empty. If you find that the folder is indeed empty, it indicates a potential bug in our snapshot script. We kindly request you to reach out to us via the
Discord Server so that we can address the issue promptly.
However, if the folder contains files and directories as expected, you can proceed with restarting your node.
$ sudo systemctl start neutrond
Ensure that your node is currently operational.
$ sudo systemctl status neutrond
$ sudo journalctl -fu neutrond