Geth Export/Import

Problem

The synchronization process of the Geth Ethereum node generates terabytes of traffic.

A big amount of traffic can cost a lot of money.


Solution (DRAFT!!!)

Sync the Ethereum Geth node with pre-downloaded blockchain in binary format.

Binary backup of the whole Ethereum blockchain was created following the official documentation


Pre Requirements:

Hardware: at least 1.2 TB of free space on storage, 8GB RAM (but 4GB can work), 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 exported folder:

lftp -e "mirror ./exported ./exported --log=downloading.log" http://api.chaindata.club 2>&1 &
disown "%lftp"

To view downloading log:

tail -f downloading.log

2. Run Geth import command:

docker run -d --rm --name import --ulimit nofile=10000:10000 -v $PWD/full-ethereum-node:/root/.ethereum -v $PWD/exported:/exported ethereum/client-go import /exported/11.7million.backup

Be ready to wait a while (can take a few hours)

3. Run Geth

mkdir full-ethereum-node

docker run -d --rm --name full-node-ethereum --ulimit nofile=10000:10000 -p 8545:8545 -p 30303:30303 -v $PWD/full-ethereum-node:/root/.ethereum ethereum/client-go --http --http.addr "0.0.0.0" --nousb --ipcdisable --syncmode full

To view geth log:

docker logs -f full-node-ethereum

3. To check actual state of the node:

docker run --rm -it ethereum/client-go --exec "eth.blockNumber" attach http://$(hostname -I | awk '{print $1}'):8545