How to reduce time to fast sync Ethereum Geth node from few days to 1 hour?
Here is the answer!
Here is a way to download data from the existing node and continue to sync:
Pre Requirements:
Hardware: at least 500 GB of free space on storage (but 450 GB can work), 8 GB RAM, 2 CPU cores
Software: all we need are lftp and docker (here is the manual for Ubuntu):
sudo apt-get update -y
sudo apt-get install docker.io lftp -y
sudo usermod -aG docker $USER
sudo su - $USER
1. Download ancient folder:
lftp -e "mirror ./chaindata/ancient ./ancient --log=downloading.log" http://api.chaindata.club 2>&1 &
disown "%lftp"
To view downloading log (be ready to wait ~10 minutes, while lftp utility indexing the remote folder):
tail -f downloading.log
2. Run Geth specify the ancient folder:
docker run -d --rm --name fast-node-ethereum --ulimit nofile=10000:10000 -p 8545:8545 -p 30303:30303 -v $PWD/fast-ethereum-node:/root/.ethereum -v $PWD/ancient:/root/ancient ethereum/client-go --http --http.addr "0.0.0.0" --nousb --ipcdisable --syncmode fast --datadir.ancient "/root/ancient"
To view geth log:
docker logs -f fast-node-ethereum
3. To check actual state of the node (be ready to wait until geth finished upgrading chain index):
docker run --rm -it ethereum/client-go --exec "eth.syncing" attach http://$(hostname -I | awk '{print $1}'):8545