How to use ready-to-go chain backup

NOTICE

NOTICE

  • Chain DB Backup version is now Openethereum-v3.2.5.

  • EW Chain and Volta Chain is currently running with Parity-v2.5.13.

  • Parity (v2.5.13) DB version is not compatible with OpenEthereum (v3.2.5) DB.

  • If anyone wants to use the present chain db backup, please update the node with Openethereum-v3.2.5. To update the node, check this pagehttps://energyweb.atlassian.net/wiki/spaces/EWF/pages/706478224/Updating+the+Client .

 

To give you a head start in initial node DB syncing, we made it possible to use automatically prepared chain DB backups. Here you will see the steps on how to download and use those to speed up syncing.

Steps:

Install curl/ wget on Validator node (or where you would like to download blockchain database)

  • Debian/Ubuntu

1 sudo apt install curl wget
  • Centos/RedHat

1 sudo yum install curl wget

Go to the docker-stack directory and stop parity container (or wherever your parity client is)

1 2 3 4 5 6 7 # This path can be different for some instances/installations. Please adjust it properly # If you will get "cd: docker-stack: Permission denied" message # then escalate your permissions with "sudo su" command. cd $HOME/docker-stack > docker-compose stop parity

Now go to the $HOME/docker-stack/chain-data/chains directory and remove/move chain db

Depending on chain (Volta/EWC) you will see proper directory Volta or EnergyWebChain

cd $HOME/docker-stack/chain-data/chains

1 2 # for Volta rm -rf ./Volta
1 2 # for EWC rm -rf ./EnergyWebChain

 

EnergyWebChain

 

Volta

 

Download chain db

  1. Download new chain file with curl command [in the $HOME/docker-stack/chain-data/chains folder]

1 2 3 4 5 6 7 8 # For EnergyWebChain cd $HOME/docker-stack/chain-data/chains curl -L -C - https://chain-download.energyweb.org/ewc -o energywebchain.tar # For Volta cd $HOME/docker-stack/chain-data/chains curl -L -C - https://chain-download.energyweb.org/volta -o volta.tar
  • Download new chain file with wgetcommand [in the ~/docker-stack/chain-data/chains folder]

1 2 3 4 5 6 7 8 9 # For EnergyWebChain cd $HOME/docker-stack/chain-data/chains wget -c https://chain-download.energyweb.org/ewc -O energywebchain.tar # For Volta cd $HOME/docker-stack/chain-data/chains wget -c https://chain-download.energyweb.org/volta -O volta.tar

2. Unpack downloaded file [in the $HOME/docker-stack/chain-data/chains folder]

1 2 3 4 5 # For EnergyWebChain sudo tar -xvf energywebchain.tar # For Volta sudo tar -xvf volta.tar


Now you should have the tar file in chandb directory

EnergyWebChain

1 2 3 cd $HOME/docker-stack/chain-data/chains > ls EnergyWebChain EnergyWebChain.tar ver.lock

Volta

1 2 3 cd $HOME/docker-stack/chain-data/chains > ls Volta Volta.tar ver.lock

 

3. Go back to the docker-stack directory and start again your parity container

1 2 3 cd $HOME/docker-stack > docker-compose start parity

4. Observe logs if parity and telemetry logs started to sync

1 2 > docker-compose logs -f --tail 200 parity > docker-compose logs -f --tail 200 parity-telemetry
  • If every thing works well, delete the downloaded .tar file.

    • 1 2 3 4 > cd $HOME/docker-stack/chain-data/chains > rm -rf volta.tar # Or > rm -rf energywebchain.tar

Known Issue:

  • Sometimes, It is noticed that the parity container takes bit time to launch.

  • The parity container might halt at beginning to launch

  • Add the following in the [footprint] section in parity-signing.toml file

    • pruning_history = 1000

    • Restart Docker container -

    • docker-compose restart

  • Try to launch 2-3 times , wait and check -

> cd $HOME/docker-stack/

> docker-compose logs -f parity

parity_1 | Loading config file from /parity/config/parity.toml
parity_1 | 2021-05-21 13:14:28 UTC Starting OpenEthereum/v3.2.5-stable/x86_64-linux-musl/rustc1.47.0
parity_1 | 2021-05-21 13:14:28 UTC Keys path /home/openethereum/.local/share/io.parity.ethereum/keys/Volta
parity_1 | 2021-05-21 13:14:28 UTC DB path /home/openethereum/.local/share/io.parity.ethereum/chains/Volta/db/d94a0a739a3e416a
parity_1 | 2021-05-21 13:14:28 UTC State DB configuration: fast
parity_1 | 2021-05-21 13:14:28 UTC Operating mode: active
parity_1 | 2021-05-21 13:14:28 UTC Configured for Volta using AuthorityRound engine

If that doesn’t work, It is recommended to start DB syncing from scratch.

> cd $HOME/docker-stack/chain-data/chains/

> rm -rf volta.tar Volta

Or

> rm -rf energyweb.tar EnergyWebChain

> cd $HOME/docker-stack

> docker-compose up -d --force-recreate

 

Parity sometimes need more time after when database has been imported to start sync again.
In some cases removing parity/chain-data/chains/Volta/network/nodes.json file can speed up that step.

Remember to remove/move downloaded tar file after successfully completed steps.