Use Chaindata Snapshots
You can start a node from an already-synced database called a chaindata snapshot. A chaindata snapshot is a compressed Kaia data directory.
노트
This saves time to Full Sync the whole blockchain, allowing you to relatively quickly start a new node or recover from corrupt database.
Prepare Data Directory
Before start, prepare enough disk space to accommodate both compressed file and uncompressed directory.
- If you're going to start from an empty machine, simply create a datadir.
sudo mkdir /var/kend
- If you're going to swap the existing directory, create a temporary directory.
- Option 1. Mount a new disk (Recommended for optimal disk utilization)
$ lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTnvme2n1 259:0 0 3500G 0 disk /var/kend2 # New disk at temporary pathnvme1n1 259:0 0 4000G 0 disk /var/kcnd # Old disk at production pathnvme0n1 259:2 0 8G 0 disk├─nvme0n1p1 259:3 0 8G 0 part /└─nvme0n1p128 259:4 0 1M 0 part
- Option 2. Use existing disk
sudo mkdir /var/kend2/data
- Option 1. Mount a new disk (Recommended for optimal disk utilization)
Download the File
Download a compressed file to the new directory. URLs can be found at the bottom of this page.
- Option 1. curl
curl -O https://s3.ap-northeast-2.amazonaws.com/klaytn-chaindata/mainnet/kaia-mainnet-chaindata-xxxxxxxxxxxxxx.tar.gz
- Option 2. wget
wget https://s3.ap-northeast-2.amazonaws.com/klaytn-chaindata/mainnet/kaia-mainnet-chaindata-xxxxxxxxxxxxxx.tar.gz
- Option 3. axel
# Amazon Linux installation examplesudo amazon-linux-extras install epelsudo yum install axel pigz# Multi-threaded download and print status baraxel -n8 https://s3.ap-northeast-2.amazonaws.com/klaytn-chaindata/mainnet/kaia-mainnet-chaindata-xxxxxxxxxxxxxx.tar.gz | awk -W interactive '$0~/\[/{printf "%s'$'\r''", $0}'
Decompress the File
- Option 1. tar
tar -xvf kaia-mainnet-chaindata-xxxxxxxxxxxxxx.tar.gz
- Option 2. tar and pigz
# Amazon Linux installation examplesudo yum install pigz# Multi-threaded decompressiontar -I pigz -xvf kaia-mainnet-chaindata-xxxxxxxxxxxxxx.tar.gz
Swap the data directory
- First, stop the node.
- IMPORTANT: If you are running a consensus node (CN), make sure to remove the node from the Council.
- Option 1. Swap the content at the same path
- If you mounted new disk, change the mount.
umount /var/kend # Old diskumount /var/kend2 # New disk at temporary pathmount /dev/nvme2n1 /var/kend # New disk at production path
- If you used existing disk, rename the directory.
mv /var/kend /var/kend_old # Old datamv /var/kend2 /var/kend # New data
- If you mounted new disk, change the mount.
- Option 2. Change the path in the node configuraion
- Change
DATA_DIR
value in thekend.conf
file.
- Change
- Optionally delete old data and tar.gz file.
- Finally, start the node.
Downloads
For efficiency, only batch pruned (state migrated) or live pruned database are provided. Read Storage Optimization for their concepts. If you want a full database without neither pruning, or even archive data, perform a fresh full sync from genesis.
network | sync options | download |
---|---|---|
mainnet | state migrated | https://packages.kaia.io/mainnet/chaindata/ |
mainnet | live pruning | https://packages.kaia.io/mainnet/pruning-chaindata/ |
kairos | state migrated | https://packages.kaia.io/kairos/chaindata/ |
kairos | live pruning | https://packages.kaia.io/kairos/pruning-chaindata/ |