Applying a Snapshot to the Crossfi Node

Using a snapshot can significantly speed up the synchronization of your node by downloading a chunk of the blockchain directly. Here is how to apply a snapshot to your Crossfi node:

  1. Stop the Crossfi Node Service

    First, ensure that the Crossfi node is not running.

    sudo systemctl stop crossfid
  2. Backup the Current Validator State

    Back up your current priv_validator_state.json to prevent any loss of data.

    cp $HOME/.mineplex-chain/data/priv_validator_state.json $HOME/.mineplex-chain/priv_validator_state.json.backup
  3. Remove Old Data

    Clear out the existing data directory.

    rm -rf $HOME/.mineplex-chain/data
  4. Set the Snapshot Name

    Define the name of the snapshot file you're going to use.

    SNAP_NAME="crossfi-snapshot-20240305.tar.lz4"
  5. Download and Extract the Snapshot

    Fetch the snapshot using curl and extract it directly into the .mineplex-chain directory.

    curl http://crossfi-toolkit.coinsspor.com/${SNAP_NAME} | lz4 -dc - | tar -xf - -C $HOME/.mineplex-chain
  6. Restore the Validator State

    Once extraction is complete, restore the priv_validator_state.json from the backup.

    mv $HOME/.mineplex-chain/priv_validator_state.json.backup $HOME/.mineplex-chain/data/priv_validator_state.json
  7. Restart the Crossfi Node Service

    After the snapshot is applied and the validator state is restored, restart the node.

    sudo systemctl restart crossfid
  8. Monitor the Logs

    Finally, check the logs to ensure that the node is running correctly.

    journalctl -u crossfid -f --no-hostname -o cat

Make sure to replace 20240305 with the date of the snapshot you wish to use if you're using a different one.

Manual Backup and Restoration with Crossfi Toolkit

The screenshot displays a webpage with the URL http://crossfi-toolkit.coinsspor.com/. It is an index of a directory showing three files: addrbook.json, crossfi-snapshot-20240305.tar.lz4, and genesis.json, along with their last modified dates and file sizes.]

Files Available

  1. addrbook.json: This file contains a list of peers that your node can connect to for syncing with the network.

  2. genesis.json: The genesis file is used when initializing your blockchain and contains all the initial configurations.

  3. crossfi-snapshot-20240305.tar.lz4: A compressed snapshot of the blockchain up to the specified date which can be used to quickly sync your node with the network.

Using the Toolkit

Downloading Files Manually

  • To download a file manually, click on the file name in the index.

  • For example, to download the genesis.json, you would click on the corresponding link in the index.

Applying a Snapshot

To apply a snapshot from the toolkit, you would:

  1. Stop your node's service:

    sudo systemctl stop crossfid
  2. Back up the current state of your validator to avoid losing any important data:

    cp $HOME/.mineplex-chain/data/priv_validator_state.json $HOME/.mineplex-chain/priv_validator_state.json.backup
  3. Remove the old blockchain data to prepare for the snapshot:

    rm -rf $HOME/.mineplex-chain/data
  4. Navigate to the toolkit index in your web browser and download the latest snapshot file by clicking on it.

  5. Decompress the snapshot file and apply it to your node:

    lz4 -dc crossfi-snapshot-20240305.tar.lz4 | tar -xf - -C $HOME/.mineplex-chain
  6. Restore your validator state from the backup:

    mv $HOME/.mineplex-chain/priv_validator_state.json.backup $HOME/.mineplex-chain/data/priv_validator_state.json
  7. Restart your node's service:

    sudo systemctl restart crossfid
  8. Monitor your node's logs to ensure it starts syncing:

    journalctl -fu crossfid -o cat

Note: Applying a snapshot will overwrite the current blockchain data. Ensure you have backups and that you're applying a trusted snapshot. This process can be risky if not done correctly, as it can lead to a loss of data or state corruption.

Last updated