Skip to main content

Node update

Table of contents

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

  1. 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.

  2. Back up your node.config and genesis.txt.

  3. Check your node version by running the following command:

    curl -s http://{your_node_hostname}:1080/api/node/status | jq .status.ver
    note

    Your 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
note

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:

  1. Stop the node:

    docker stop tpnode
  2. Delete the container:

    docker rm tpnode
  3. Update the Docker image:

    docker pull thepowerio/tpnode
  4. 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:

  1. Go to your source code directory:

    cd path/to/your/sources
  2. Update your source code:

    git pull 
  3. Build your node according to this guide.

  4. Stop your node after it is built:

    systemctl stop tpnode.service
  5. Replace your node code by rewriting the versions of directories:

    bin
    erts-*
    lib
    releases
    warning

    DO NOT update or delete the db directory.

    OPTIONAL:

    You can delete all files, including *.dump files from log directory.

  6. Start your node:

    systemctl start tpnode.service