Backup and Restore
Introduction
Running a Change Chain node allows you to participate in the network by validating transactions, contributing to network security, and earning mining rewards. To ensure the continuity of your node's operation in case of hardware failures, software issues, or unforeseen disasters, it's essential to have a reliable backup and restore strategy.
This guide provides detailed instructions on how to back up and restore your Change Chain node efficiently. By focusing on the essential files unique to your node, you can minimize downtime and quickly recover your node without having to back up large volumes of data.
Essential Files to Backup
The essential files that uniquely identify your Change Chain node are:
nodekey
: This file contains the private key that defines your node's identity (NodeID
) on the network.Wallet Files (if applicable): If your node manages any wallets or accounts, you should back up the keystore files associated with them.
Location of Essential Files
By default, these files are located in the following directory:
Linux/macOS:
~/.changechain/
Windows:
C:\Users\YourUsername\.changechain\
Backup Procedure
Step 1: Locate the Essential Files
Navigate to the directory where your node's data is stored.
Linux/macOS:
Windows (Command Prompt):
Step 2: Identify the Files to Backup
nodekey
: The file that stores your node's private key.Keystore Directory (if applicable): Contains wallet files.
Step 3: Stop the Node (Optional but Recommended)
To ensure data integrity, it's recommended to stop your node before copying the files.
Step 4: Copy the Files to a Safe Location
Copy the essential files to a secure backup location, such as an external hard drive or a secure cloud storage service.
Example:
Important Notes:
Security: Ensure that the backup location is secure. Anyone with access to these files can impersonate your node or access your wallets.
Privacy: Do not share these files with anyone. Keep them encrypted if possible.
Step 5: Restart the Node (If Stopped)
If you stopped your node in Step 3, restart it.
Restore Procedure
Step 1: Install Change Chain Node on the New Machine
Set up the Change Chain node on the new machine by following the Running a Change Chain Node guide.
Step 2: Stop the Node on the New Machine
Before restoring the backup files, stop the node if it's running.
Step 3: Replace the Essential Files
Copy the backed-up files to the appropriate directory on the new machine.
Example:
Ensure that the file permissions are correctly set:
Step 4: Restart the Node
Start the node on the new machine.
Step 5: Verify Node Identity
After the node starts, verify that it retains the original NodeID
.
Retrieve the NodeID
Check that the NodeID
matches the one from your previous node.
Database Backup and Restore (Optional)
While the blockchain data can be re-downloaded through the bootstrapping process, you may choose to back up the database to reduce synchronization time.
Backup the Database
Step 1: Stop the Node
Step 2: Compress the Database Directory
Note: Compressing the database may take some time depending on its size.
Restore the Database
Step 1: Transfer the Backup to the New Machine
Copy the changechain_db_backup.tar.gz
file to the new machine using scp
, rsync
, or any secure file transfer method.
Example using scp:
Step 2: Extract the Database
Step 3: Start the Node
Step 4: Verify Synchronization
Check the node logs or use RPC methods to ensure the node is synchronized and functioning correctly.
Important Considerations
Single Instance per NodeID: Ensure that only one instance of your node is running with the same
NodeID
. Running multiple nodes with the same identity can lead to network issues and may affect your mining rewards.Security of Backup Files: Keep your backup files secure. Unauthorized access to your
nodekey
can compromise your node's identity.Wallet Security: If you manage wallets or accounts on your node, ensure that the keystore files are also securely backed up and restored.
Last updated