Ask or search…

7. Updating a node

1. How to perform an update

From time to time, there will be new versions of Tezos. Follow Tezos Foundation on twitter and the Official Tezos Gitlab to ensure you don't miss any important releases.
Tip: When picking some downtime for maintenance like updating your node, choose a time where your baker has a longer break until next baking or next endorsing.
To update with ~/tezos as the current binaries directory, copy the whole Tezos directory to a new place so that you have a backup and can also leave the current processes running.
git clone tezos2
Tezos Version 8.0 aka Edo requires the installation of the Rust framework and zcash params. Install with the following.
chmod +x
./ --profile minimal --default-toolchain 1.44.0 -y
source $HOME/.cargo/env
chmod +x
Change to the new directory and rebuild the latest binaries. Run the following command to pull and build the latest Tezos binaries.
cd ~/tezos2
git checkout latest-release
make build-deps && eval $(opam env) && make
Stop your node by Ctrl-C. If you stop your node first, then baker, accuser and endorser will automatically stop. Or, if you're using auto-start scripts with systemd, use the command sudo systemctl stop tezos-node.service
The following commands will quickly switch-over to your newly built Tezos binaries while keeping the old directory for backup.
mv tezos/ tezos-old/
mv tezos2/ tezos/
Now restart your node, baker, endorser, and accuser processes.

2. Handling updates with new protocols

Tezos performs regular on-chain governance by election. These elections progress through four stages and can conclude with a protocol upgrade which results in a new set of binaries. This is what makes Tezos self-amending.
When a new protocol is successfully promoted and scheduled to occur at a later date, you run both the current protocol and future protocol binaries.
For example, you would expect to run 7 binaries
After the future protocol"007"activates on a later date, you can stop the previous binaries. In this example, you would stop all the006 binaries.

3. Update auto-start and monitoring systemctl configs

First, stop all tezos services and ensure the services are truly stopped.
sudo systemctl stop tezos-node.service
sudo systemctl status 'tezos-*.service'
You need to update the binaries names for the ExecStart variable. The path must reflect the new binaries.
The files to update are:
  • /etc/systemd/system/tezos-node.service
  • /etc/systemd/system/tezos-endorser.service
  • /etc/systemd/system/tezos-baker.service
  • /etc/systemd/system/tezos-accuser.service
#Example, change "tezos-endorser-006-PsCARTHA"
ExecStart = /home/replaceUsername/tezos-endorser-006-PsCARTHA run ledger_mybaker
Typically you only need to update 3 filenames: the endorser, baker, and accuser filename.
Now reload the new config with the following command:
systemctl --user daemon-reload
And restart services,
sudo systemctl reload-or-restart tezos-node.service
Verify the node, baker, endorser, accuser processes are all running.
sudo systemctl status 'tezos-*.service'

4. In case of problems

4.1 Forked off

Forget to update your node and now your node is stuck on an old chain?
Run this command to resume validating blocks.
./tezos-admin-client unmark all invalid blocks

4.2 Roll back to previous version from backup

Following the above guide, you can simply restore the old Tezos directory.
Then try the update procedure again.
mv tezos/ tezos-rolled-back/
mv tezos-old/ tezos/

4.3 Last resort: Rebuild from source code

Follow the steps in section 2. Getting and building Tezos from source​