Updating

Time: 1.5h

Before you get started, make sure your Pi is up-to-date with sudo apt update and sudo apt upgrade -y.

Go to the application directory.

cd ~/bitcoin

Update the repository with the latest changes via Git.

git fetch --all

Show the latest version/tag/release.

git describe --tags `git rev-list --tags --max-count=1`

Retrieve the changes from the latest release.

git checkout -f <OUTPUT OF PREVIOUS STEP> #example: v25.0

Be sure to start from a clean slate. It could prevent some errors later on.

make clean

Rebuild bitcoin Knots based on the version of the source code you just checked out. The addition of -j $(nproc) uses all the cores of the CPU and would make the build faster than it would be without this addition.

make -j $(nproc)

The build will finish in about an hour. Nice time for a beer or cup of coffee!

Stop services that depend on Bitcoin Knots, such as btc-rpc-explorer, LND or Electrum. You know best which ones you have running. From experience, not turning off services that depend on Knots doesn't really matter. The services will temporarily not receive data from during Knots update, after which it will resume once Knots is turned back on.

Stop the bitcoind service:

sudo systemctl stop bitcoind

Now install the software. This will take up to 5 minutes.

sudo make install

Start the service bitcoin. The service will have started fairly quickly but the blockchain may need to download a few more blocks depending on how long the service was stopped.

sudo systemctl start bitcoind

Check the current version of bitcoin Knots.

bitcoin-cli --version

The output will look like Bitcoin Knots RPC client v25.0 and Knots is now updated!

Start the other services you may have disabled. Note that when you start LND, unlocking LND can only be done after bitcoin's blockchain has been resynchronized. Check with tail -f -n 200 .bitcoin/debug.log how far along it is. Services start this way:

sudo systemctl start bitcoind