Switching to Knots on Raspiblitz

How to switch from Core to Knots on Raspiblitz (1.11.4)

#SSH into your pi as admin:

ssh admin@raspberrypi.local

#Download the official knots bonus script from the raspiblitz repo, and make it executable:

cd /home/admin/config.scripts
wget -O bonus.knots.sh "https://github.com/raspiblitz/raspiblitz/raw/eb2d2dc43e057281adde3e7b909b65bb3573226d/home.admin/config.scripts/bonus.knots.sh"
chmod +x bonus.knots.sh

#If you are running Core Lightning, stop it:

sudo systemctl stop lightningd

#Otherwise, stop LND if you are running it:

sudo systemctl stop lnd

#Stop bitcoind, and after it is fully shutdown, replace it witth Knots:

sudo systemctl stop bitcoind && sleep 30
sudo -u admin bash -x ./bonus.knots.sh on

#Confirm that you are now running Knots!

bitcoin-cli -version

Important Note:

Core 26.x ignores some corrupt blockchain data, but Knots 28.x does not. You may need to re-index!

How to re-index the blockchain (if necessary)

#Check if a re-index is needed:

bitcoin-cli -rpcwait getblockchaininfo | jq '.blocks, .verificationprogress'

If the above command hangs forever, then you will need to re-index!

#(Optional) Confirm that corrupt blockchain data is actually the problem:

sudo grep -i -A2 -B2 "error" /mnt/hdd/bitcoin/debug.log | tail -n 40

#(if the blockchain data is corrupt, it should print log output that includes: “Corrupted block database detected. Please restart with -reindex or -reindex-chainstate to recover.”)

#Stop bitcoind, and after it fully shuts down, restart it with the -reindex directive:

sudo systemctl stop bitcoind && sleep 30
sudo -u bitcoin /usr/local/bin/bitcoind -conf=/mnt/hdd/bitcoin/bitcoin.conf -datadir=/mnt/hdd/bitcoin -reindex -daemon

#Watch the paint dry (i.e. follow the re-indexing logs). Press Ctrl+C when it finally finishes:

sudo journalctl -u bitcoind -f

#Confirm that it is actually finished (should output two identical numbers and the word “false”):

bitcoin-cli getblockchaininfo | jq '.blocks, .headers, .initialblockdownload'

#Stop bitcoind, and once it has fully shut down, reboot the pi:

bitcoin-cli stop && sleep 30
sudo reboot

If Electrs index is also corrupt

(Manifests in Raspiblitz as Mempool future blocks and fee estimates never loading)

#Stop electrs and bitcoind, and when fully shut down, delete the index and reboot:

sudo systemctl stop electrs
sudo systemctl stop bitcoind && sleep 30
sudo rm -rf /mnt/hdd/app-storage/electrs/db/bitcoin
sudo reboot

If you need to revert back to Core 26.x

#Run the bonus script’s “off” command, and reboot:

cd /home/admin/config.scripts
sudo systemctl stop bitcoind && sleep 30
sudo -u admin bash -x ./bonus.knots.sh off && sleep 30
sudo systemctl stop bitcoind && sleep 30
sudo reboot

#Note: You will need to re-index the blockchain after switching back to Core 26.x, as the 28.x database format is not backwards compatible

How to get your node’s public Tor address

(to check if you are reachable on BitNodes.io)

#While SSH’d in as admin, lookup the address via “getnetworkinfo”:

bitcoin-cli getnetworkinfo | jq -r '.localaddresses[] | "\(.address)"'

1 Like

Thanks so much Paul, love your work. Slight issue. I carried out the above and everything on Bitcoin side is great but its broke LND. It keeps asking for the lightning wallet to be unlocked but just loops when you enter correct password and asks again. Also get generic Server 500 error. I did try a full rebuild of the node (as I had just got it set up) and tried switching to Knots prior to Setup process - end result was just the same. Are there possibly API’s in Core which do not exist in Knots? Any help would be greatly appreciated!

2 Likes

Ok, let me do a little experimenting. I mainly tested with Core Lightning, so I’ll set up LND and see what I can find out.

2 Likes

Thanks Paul, your video and the above post convinced me to switch to Knots too.

And just to add, I also experienced the same error in LND as Gman.

1 Like

Thanks. I had a hardware problem with my NVMe on my Raspberry Pi, so I have a new one ordered and on the way. In the mean time, I’ll check if I can emulate a virtual Raspiblitz, but in any case it will likely be at least a couple days before I can get to investigating the LND problem.

2 Likes

Quick update: I was able to get this running in a VM (preferable to a physical Pi for debugging, since I can easily create and switch between snapshots). I just need to wait for everything to sync and I can start digging into the LND problem.

I followed tutorial, had the same LND wallet unlock failure. I was running the default LND version which is 18.3. I did the following to update to the latest version of LND which fixed the problem.

cd /home/admin/config.scripts

./lnd.update.sh reckless

this installed LND 19.1. Reboot and fixed the problem.

The only remaining issue that I can see is the web UI doesn’t report the status of Bitcoin version, etc. The status screen is correct.

2 Likes

Excellent! I’ll recreate the scenario on my VM once it is synced up, and see if I can figure out the status UI. I appreciate the help! I’ll include this info when I record Part 2.

1 Like

You guys are awesome.

I can confirm the same behavior with the LND update.

1 Like

I’m having the same issue as @Gman above. web ui has constant spinner in upper right hand corner of screen.

image

When I ssh in and try to enter my wallet address there, it just keeps looping and asking for the address over and over. Here is the error in the log immediately after I type in the password via lncli unlock,

$ sudo tail -n 30 -f /mnt/hdd/lnd/logs/bitcoin/mainnet/lnd.log
2025-06-29 00:04:24.042 [INF] LNWL: Opened wallet
2025-06-29 00:04:24.297 [ERR] LTND: unable to create partial chain control: unable to determine if bitcoind is pruned: unable to detect bitcoind version: json: cannot unmarshal array into Go struct field GetNetworkInfoResult.warnings of type string
2025-06-29 00:04:24.300 [ERR] LTND: Shutting down because error in main method: error creating wallet config: unable to create partial chain control: unable to determine if bitcoind is pruned: unable to detect bitcoind version: json: cannot unmarshal array into Go struct field GetNetworkInfoResult.warnings of type string
2025-06-29 00:04:24.301 [INF] LTND: Shutdown complete2025-06-29 00:05:25.302 [WRN] LTND: Config 'bitcoin.active' is deprecated, please remove it

Hope this helps.

Thanks for the details. Did raspberry’s suggestion fix the problem, or do you still see the error even with the newer LND version installed?

Yes, that fixes the looping problem but now I can’t see any information about the blockchain.

So not sure if upgrading to 19.1 is the proper fix.

Hi, i am not good in Coding and terminal etc….

but i found a quick fix for the problem for the Lighting Password cycle for my node (not a solution, only that it dose not show any more):

→ ssh in to your node (i dont use (i think it’s called) the UI)
→ Go to “Menu”
→ “Settings” (Node Settings & Options)
→ “LND Auto-Unlock” (press spacebar to enable)
→ Enter your Password
→ press “OK” to confirm

Since then the password cycle dose not show up anymore.

I hope you do not laugh about my “quick fix” (only temporary until a proper solution is presented)

(If my post is BS please delete this post or tell me to delete it) :))

Have a good day and thank for your feedback

2 Likes

Hi
Has anyone the same problem with the node loosing the peers and is not able to connect to other peers at the 73% Chain download mark?

Hi Paul. Many thanks for your work. I am ready to move from Core to Knots on my Raspiblitz server, (RPi 4) and your guide above ad video are most of what I need to proceed. I have a question however:

I have some BTC in my BTC on-chain wallet in Raspiblitz. I am concerned about what might happen to this after switching to Knots.

Will my wallet and its contents be unaffected?
Are there any risks that I will lose access to the wallet and its contents during or after the switch to knots?
Should I move the BTC out of the wallet and then back in after the switch is complete and tested?

Any advice would be most gratefully received.

Thanks in advance

Ian. (a very new node runner)

Normally, I would say you should be safe to not move the BTC before switching from Core to Knots, but Raspiblitz in my experience is considerably less stable than other server solutions, and the version upgrade required is relatively large, so I would recommend backing up everything (or moving it off the node as you suggested) just to be safe in case of something going wrong that requires rebuilding your server.

When you set up your node, you should have been given a 24-word backup phrase (AKA an “aezeed”). This will restore your node’s base-layer wallet. If you do not have it, then definitely move your BTC out of the wallet (and think about closing all channels and rebuilding a new node with a new backup phrase). The phrase, however, doesn’t restore your channels, if I am not mistaken. For that, Raspiblitz has something called a “Static Channel Backup” (SCB) – a file called channel.backup. You should be backing up this file periodically. Grab the latest backup before starting the migration. If you don’t have automatic backups setup, you should be able to grab one like so:

SSH into the Pi, and run:

sudo cp /mnt/hdd/lnd/data/chain/bitcoin/mainnet/channel.backup /home/admin/
sudo chown admin:admin /home/admin/channel.backup
exit

Then copy the file to your laptop or PC (adding the date to the filename for reference):

scp admin@raspiblitz.local:/home/admin/channel.backup ./raspiblitz_scb_<date>.backup

Disaster-recovery playbook (assuming you are running LND):

  • Reinstall RaspiBlitz and let Bitcoin Core sync :cry:.
  • Run LND and choose “restore from seed” (enter aezeed, and passphrase if you set one).
  • Import your SCB (Seed+SCB path in the RaspiBlitz setup menu). Your channels will be closed automatically and funds returned on-chain after confirmations.

Many thanks for a very prompt and helpful reply Paul. I will proceed with the switch to Knots tomorrow following your guide above and your safety related comments in the reply you kindly sent me.

FYI, my node was built a couple of weeks ago and is running Core 26.0.0 and LND_GRPC 0.18.3-beta

I have not used the Lightning functionality having only deposited some Sats into the base wallet so far.

I shall let you know the result once I am done.

Regards

Ian

p.s. I did get a seed phrase at initial setup which I have obviously kept safe.

1 Like

Cool, that makes it easier then. The seed phrase will be sufficient for recovery then, since the other one is just for Lightning channels.

1 Like

Hi Paul.
an update;-

I managed to perform the switch to Knots but upon reboot, in the SSH UI, when prompted for my LND password (password 3 in Raspiblitz UI), my password would not work.

As I have installed RPBlitz with the WebUI, I also browsed to my UI where I was also prompted for my LND password, which again when entered, failed.

So I reinstalled RPBlitz on a fresh SD card then booted up and was back to where I started (with Core of course). My on chain BTC balance was intact so no harm done.

I tried once more to install Knots but ended up in the same place.

Tomorrow, I shall reinstall RPBlitz again to get my server back running again, but I am at a loss as to how to resolve the LND password issue after the switch to Knots.

In case it is relevant, I have not funded my LND Wallet in either my original and 2nd RPBlitz install that I did today. Would the issue be something to do with that? No LND activity so no LND history to backup??

Any help would be much appreciated as is your help and advice so far.

For now, I am stuck with BTC Core I guess but having read a lot about the changes coming in Core, I am committed to moving to Knots once I can do so successfully.

I’ll play around with this when I get some free time. I don’t recall getting into that situation, so I’ll see if I can recreate it. The sync process on Raspiblitz is always a pain, haha, so I lost a little patience with testing on it before. I think I’ve had enough of a break to get back to it :slight_smile:

1 Like