1

I'm using Geth version 1.8.17-stable on ubuntu server and syncing with "fast" mode. I want to upgrade Geth to v1.8.23 to sync blocks generated after the hard fork. But I couldn't find how to upgrade it like my question. I'm not sure that I have to stop running Geth or not. And if I have to stop Geth and update it, then how could I do it without removing synced data? I thought if I stop Geth, and run it again, I would have to delete the data because it crashes with the giving sort of message "Your database is not clean". (I'm not sure with the log message but it was like this by my memory.)

2

I was little bit worried about re-syncing all the stuff again, but it was just a concern. I figured it out now. I'll share it how I did it. I used ubuntu server, so I'll talk about this.

Step 1. Stop the Geth which was running.

kill -9 <geth pid>

Step 2. Upgrade Geth version.

sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get upgrade

Step 3. Run Geth fast mode at background.

It was simple. At first, the log will show this kind of message.

INFO [03-05|04:54:51.890] Upgrading chain index             type=bloombits percentage=25

With this log, the server keeps syncing with ethereum network. After the percentage gets to 100, when typing eth.syncing at geth console, the highestBlock number would change to near the latest.

  • 2
    Killing the process is usually a bad idea as systemd might try to start it while you're upgrading. Just use "services geth stop", then "sudo aptitude update" to get the latest sources, "sudo aptitude upgrade geth", and just start the service back "service geth start", and you're all done. – Micky Socaci Mar 5 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.