Document history
Date | Changes |
18. December 2020 | Published |
Important notes & disclaimer
This guide is provided without any warrenty/guarantee (“as is”). Feel free to let us know your feedback! We are happy to apply healthy critique to this guide!
Overview
To maintain an Ethereum 2.0 staking node we’ll look at two different topics:
- OS Ubuntu 20.04 updates
- ethereum2-docker-compose updates (which includes version updates of clients as well as monitoring)
OS updates
It’s not recommended to run automatic updates because of different reasons, the major one is obviously when updates happen the operator of the node (most likely you) is busy with sleeping, family, work or other important things. In the unlikely event of something goes wrong it’s always a good idea to schedule some time to do this.
Run updates
Let’s get the updates and install the updated packages on Ubuntu 20.04 (other versions of Ubuntu won’t differ at all or just very slightly):
sudo apt update && sudo apt upgrade -y
After successful update Ubuntu will tell you if it’s necessary to reboot the host. If so, just do a quick reboot:
sudo reboot
Depending on your hardware the reboot process takes a few seconds (small VPS or PCs) to several minutes (data centre server graded hardware).
Because of the unpredictability of issues while updating operating systems we can’t provide any further information on how to resolve them. However feel free to join our Discord if you run into troubles.
Updating ethereum2-docker-compose
When using ethereum2-docker-compose of stereum the update process is quite easy because it comes with a script to simplify. Go to your installation folder, set permissions and execute the script:
cd /opt/ethereum2-docker-compose
chmod +x edc-update.sh
./edc-update.sh
The script will safe your changes, then pull any updates and apply your changes again. It also recognizes your setup (multiclient, lighthouse, prysm, …) and checks for any changes on the docker-compose.yaml
you use.
Conflicts
When updating config files it’s possible that your changes might interfere with updates. If there are any conflicts the script will tell you, looking like this:
Conflicts (please edit the files before restarting any services):
config/prysm/validator.yaml
Then edit these files by executing nano ...
for each, e. g.:
nano config/prysm/validator.yaml
And choose the lines you wish to keep. If you’re unsure about how to do that in detail, take a look at this excellent guide on how to read and resolve conflicting lines.
docker-compose.yaml
Because at the setup of your node you copied the docker-compose.yaml
to your installation root’s directory changes are not applied automatically. However, if there are any changes you need to be aware of the script will notify you with the following line:
Important: compose-examples/lighthouse-only/docker-compose.yaml was updated! Make sure to copy the new docker-compose.yaml to the project's root.
You can view the new file with
nano compose-examples/lighthouse-only/docker-compose.yaml
and decide if you want to copy it or not, or just take part of the updates by copying the updates by hand. This choice is necessary because updating the docker-compose.yaml
automatically might cause unforeseeable side effects to any modified setup. If you didn’t adapt the original docker-compose.yaml
you can simply copy the new one but making a backup of the old one just in case:
mv docker-compose.yaml docker-compose.yaml.old cp compose-examples/lighthouse-only/docker-compose.yaml .
Restart Ethereum 2.0 node
The running containers don’t get the new updates immediately, to make sure to propagate any updates shut down the node and start it up again, also make sure the script to start up got the correct permissions:
chmod +x edc-up.sh docker-compose down ./edc-up.sh
That’s it, your node is updated and staking again!