Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drandreaskrueger/88cf4e27c69272e68d44076aaf9a8844 to your computer and use it in GitHub Desktop.
Save drandreaskrueger/88cf4e27c69272e68d44076aaf9a8844 to your computer and use it in GitHub Desktop.
parity-how-to-sync? --> cloudmachine sync, chain zip, download, perhaps publish at mega.nz

create bootstrap file for syncing parity to chain tip (v02)

Why? It has become near impossible to sync.

See issues openethereum/parity-ethereum#8145
openethereum/parity-ethereum#7801 (comment)
openethereum/parity-ethereum#8215 (comment)
openethereum/parity-ethereum#8148 (comment)

Strategy: Sync in the cloud, zip the chain, download, unpack locally.

Get a cheap cloudmachine, e.g.

  • only 3 Euros/month at https://cloud.scaleway.com/#/signup with 2GB memory, 2 cores, 200Mbit/s, 50GB LSSD, or
  • for 5 USD/month at digitalocean (with this link you get 10$ welcome bonus) you get 1 GB mem, 1 CPU, 25 GB, and 1 TB transfer free.

... create server ... wait a minute ...

(actually, you might have to configure the "security group", and/or insert your ssh key (for ssh-login) at https://cloud.scaleway.com/#/credentials , but I had done all that long ago, and don't remember. Feel free to add details to this manual.)

Connect (example IP):

ssh root@51.15.100.155

sudo apt update && sudo apt -y upgrade
sudo apt install gdebi zip megatools

# https://github.com/paritytech/parity/releases
wget http://d1h4xl4cr1h0mo.cloudfront.net/v1.9.6/x86_64-unknown-linux-gnu/

gdebi parity_1.9.6_ubuntu_amd64.deb
parity --version

parity --pruning fast > parity-syncing.log 2>&1 &
tail -f parity-syncing.log

exit

... come back a few hours or days later ...

ssh root@51.15.100.155
tail -f parity-syncing.log

Has it synced to the block that www.etherscan.io / www.etherchain.org are showing?
If not, then come back a week later ;-) ...
If yes, then kill parity, wait a moment, and then zip the database:

pkill parity
sleep 20
zip -r parity-mainchain.zip ~/.local/share/io.parity.ethereum/chains/ethereum/db/906a34e69aec8c0d/

Now from your local machine (where you want to use the bootstrap file) request the file from the cloudmachine (in my case approx 3 hours download), and unpack into the correct folder:

scp root@51.15.100.155:parity-mainchain.zip .

FOLDER=~/.local/share/io.parity.ethereum/chains/ethereum/db/906a34e69aec8c0d
rm -rf $FOLDER
unzip parity-mainchain.zip -d $FOLDER
rm parity-mainchain.zip

Ready! Now your local machine should sync quickly, adding only the blocks of the last few minutes :

parity --pruning fast

If there are problems, you might not have the same parity version locally, that you had used in the cloud, so also install the same version locally:

https://github.com/paritytech/parity/releases --> v1.9.6 --> choose your OS, then:

pkill parity
parity --version
wget http://d1h4xl4cr1h0mo.cloudfront.net/v1.9.6/x86_64-unknown-debian-gnu/parity_1.9.6_debian_amd64.deb
sudo gdebi parity_1.9.6_debian_amd64.deb
parity --version
parity --pruning fast

If you want to help others with your bootstrap file, why not also upload it, to e.g. Kim's mega.nz (took only 15 minutes):

export MUSER=<your email address>
export MPASS=<your mega.nz password>
export FILENAME=parity-mainchain_$(date -I)_.zip
mv parity-mainchain.zip $FILENAME
megaput -u $MUSER -p $MPASS $FILENAME
megals -u $MUSER -p $MPASS 

In the mega-webfrontend, go to the menu (top right), and reload, to see the new files.
Infos about the mega CLI tools: https://github.com/megous/megatools

my bootstrapping files:
23/4/2018 https://mega.nz/#!VzwwyLzL!nto17YDIuD1rCzg7h4ST6ew8skQLE5dbhogdbvzC7J4

If all is good now, you can destroy the cloudmachine instance. Remember to also destroy the IP address, otherwise costs might occur: https://cloud.scaleway.com/#/

But from now on, you may never switch off your local machine anymore, because catching up has become difficult: Zeno's Paradox

Or perhaps you keep that cloud machine running? 3 Euros per month, for an always synced chain?

Anyways, I hope these instructions help you as much as this (admittedly odd approach) helped me.

If yes, then consider to donate: [ETH] 0x008B32b996745b89bfdED64488DeA074EF52f4b8

Thx.


home of this text: https://gist.github.com/drandreaskrueger/88cf4e27c69272e68d44076aaf9a8844

@drandreaskrueger
Copy link
Author

Idea had come up here: openethereum/parity-ethereum#8145 and in the other cross-linked issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment