Blockchain Snapshot: How to Manually Apply It to the DeFiChain Desktop Wallet

From DeFiChain-Wiki

Blockchain Snapshot: How to Apply It to the DeFiChain Desktop Wallet

This guide explains how to manually apply a blockchain snapshot to the DeFiChain Desktop Wallet. Snapshots allow you to quickly synchronize your wallet without starting from block 0, though a full sync is the most decentralized and reliable method.

Preparation: Create a Backup

Before proceeding, back up your wallet data to prevent potential data loss.

Using the Wallet App

1. Open the DeFiChain app.

2. Navigate to Settings → Backup Wallet and save the backup in a secure location.

3. Close the app.

Manually via File System

1. Quit the DeFiChain app.

2. Locate the wallet data in the default directories:

  * Windows: C:\Users\%username%\AppData\Roaming\DeFi Blockchain\wallets
  * Linux: ~/.defi/wallets
  * macOS: /Users/%username%/Library/Application Support/DeFi/wallets

3. Copy the `wallets` folder to a secure location.

Note: Verify that these directories match your setup if you have customized your installation paths.

Snapshot Sources and Download

Where to Find Snapshots

Snapshots can be downloaded from the following sources:

Downloading Snapshots

1. Check the index.txt: Open the file in a browser to see available snapshots. Example content:

  snapshot-mainnet-4554785.zip

2. Build the Download Link: Construct the URL using the filename from the index.txt. Example:

  https://snapshot-de.mydefichain.com/snapshot-mainnet-4554785.zip

3. Check Block Height: Visit https://defiscan.live/blocks to confirm the current block height. Ensure the snapshot you select is close to this height for faster synchronization.

4. Start the Download:

  * Windows/macOS: Download using a browser.
  * Linux: Use the command:  
    wget https://snapshot-de.mydefichain.com/snapshot-mainnet-4554785.zip

File Types

  • .zip (Universal): 33.25 GB
  • .tar.gz (Linux preferred): 21.51 GB

Installing the Snapshot

Windows

1. Download the Snapshot: Use the URL built from index.txt.

2. Remove Old Blockchain Data:

  * Navigate to C:\Users\%username%\AppData\Roaming\DeFi Blockchain.
  * Delete all folders except for wallets.

3. Extract the Snapshot: Unzip the file into the blockchain directory.

4. Start the App: Launch the DeFiChain app. Synchronization will begin from the snapshot block.

Linux

1. Download the Snapshot: Follow the steps above to retrieve the .zip file.

2. Remove Old Blockchain Data:

  * Stop the node:  
    ~/.defi/defi-cli stop
  * Remove old data:  
    rm -rf ~/.defi/anchors ~/.defi/blocks ~/.defi/burn ~/.defi/chainstate ~/.defi/enhancedcs  ~/.defi/history ~/.defi/indexes ~/.defi/spv

3. Extract and Move the Snapshot:

  * Unzip the file:  
    unzip snapshot-mainnet-4554785.zip
  * Move the files:  
    mv ./* ~/.defi/

4. Start the Node:

  * Start:  
    ~/.defi/defid
  * Check the status:  
    tail -fn50 ~/.defi/debug.log

macOS

1. Download the Snapshot: Use the URL from index.txt to download the file.

2. Remove Old Blockchain Data:

  * Navigate to /Users/%username%/Library/Application Support/DeFi/.
  * Delete all files and folders except for wallets.

3. Extract the Snapshot: Unzip the downloaded file into the blockchain directory.

4. Start the App: Open the DeFiChain app. Synchronization will start from the snapshot block.

Important Notes

  • Always verify the current block height on https://defiscan.live/blocks before downloading a snapshot.
  • Use only snapshots listed in the index.txt file to avoid synchronization issues.

Disclaimer

Personal Responsibility

This guide is provided as-is. Users are responsible for ensuring the correct execution of steps. The guide creators assume no liability for errors, data loss, or other issues resulting from the use of this guide.

No Financial Advice

This guide is purely technical and does not provide financial advice. Always consult a qualified professional for financial decisions.