Node update
Table of contents
- Disclaimer
- Before the update
- Updating your node built from Docker image
- Updating your node built from sources
Disclaimer
We recommend to use docker-compose
to build, run, and update the node. docker-compose
option allows you to automatically update your node without doing anything.
Before the update
-
Check out the Power Telegram chat, the Power news, or information about the problems with the node in Zabbix. There you will find information about the necessity of update.
-
Back up your
node.config
andgenesis.txt
. -
Check your node version by running the following command:
curl -s http://{your_node_hostname}:1080/api/node/status | jq .status.ver
noteYour node may have automatic updates configured previously. In this case, you don't need to update your node manually (only for nodes started from the Docker image).
Read this manual to learn how to configure automatic node updates using Watchtower (only for nodes started from the Docker image).
Updating your node built from Docker image
Check your node version by running the following command:
curl -s http://{your_node_hostname}:1080/api/node/status | jq .status.ver
Your node may have automatic updates. In this case, you don't need to update your node manually (only for nodes started from the Docker image).
Read this manual to learn how to configure automatic node updates (only for nodes started from the Docker image).
To update your node:
-
Stop the node:
docker stop tpnode
-
Delete the container:
docker rm tpnode
-
Update the Docker image:
docker pull thepowerio/tpnode
-
Restart your node by running the starting command:
docker run -d \
--name tpnode \
--restart unless-stopped \
--cap-add=NET_ADMIN \
--device=/dev/net/tun \
--network=host \
--mount type=bind,source=/opt/thepower/db,target=/opt/thepower/db \
--mount type=bind,source=/opt/thepower/log,target=/opt/thepower/log \
--mount type=bind,source=/opt/thepower/node.config,target=/opt/thepower/node.config \
thepowerio/tpnode
Updating your node built from sources
To update your node:
-
Go to your source code directory:
cd path/to/your/sources
-
Update your source code:
git pull
-
Build your node according to this guide.
-
Stop your node after it is built:
systemctl stop tpnode.service
-
Replace your node code by rewriting the versions of directories:
bin
erts-*
lib
releaseswarningDO NOT update or delete the db directory.
OPTIONAL:
You can delete all files, including
*.dump
files fromlog
directory. -
Start your node:
systemctl start tpnode.service