Update: I’ve published this on Y’alls as well, for those of you who wish to tip anonymously https://yalls.org/articles/97d67df1-d721-417d-a6c0-11d793739be9:0965AC5E-56CD-4870-9041-E69616660E6F/0d395aab-d85d-4039-a5cc-682950e89a9d
I’m happy to report that I now have charge-lnd working smoothly on Umbrel, in a docker. Getting this to work took me a few weeks, and generous help and a lot of patience from Jorijn (one of the developers of charge-lnd) and my friend @yuvadm. Thanks guys!
I wanted to create a guide for all of you who are non-technical (like me), so that you can simply follow along with the steps and get auto-fee management on your node. As you probably know, Umbrel is notoriously finicky about you playing with it’s core files, so my main objective here was to install all files either on the SSD, to prevent you from losing your configurations during updates, or within a docker container, so that no core system functionality or apps are disturbed
Alright, let’s begin:
1. Log in to your Umbrel’s ssh via a command line tool on your computer (Terminal on Mac, for example):
ssh -t umbrel@Umbrel.local
You’ll need your admin password, which is the one you set on the back end.
2. Create a directory on the SSD for the config file (so it doesn’t get erased upon updates or SD card reflashes)
mkdir -p /mnt/data/upgrades/charge-lnd
3. Create a config file there:
sudo nano /mnt/data/upgrades/charge-lnd/charge.config
4. Populate the file with the rules you want, using the sample config file
You can change these rules at any time, and add to them as you go along, so I suggest starting with something basic.
If you need an explanation of how the parameters and rules work, here is a list of the parameters and their explanations.
Here is my config file, for a starting reference point:
[default] # 'default' is special, it is used if no other policy matches a channel strategy = static base_fee_msat = 0 fee_ppm = 97 [ignored_channels] # don't let charge-lnd set fees (strategy=ignore) for channels to/from the specified nodes node.id = 021c97a90a411ff2b10dc2a8e32de2f29d2fa49d41bfbb52bd416e460db0747d0d strategy = ignore [leafnode] # charge non-routing (private=true) peers a bit more for our service chan.private = true strategy = static fee_ppm = 150 [proportional] # 'proportional' can also be used to auto balance (lower fee rate when low remote balance & higher rate when higher remote balance) # fee_ppm decreases linearly with the channel balance ratio (min_fee_ppm when ratio is 1, max_fee_ppm when ratio is 0 strategy = proportional min_fee_ppm = 50 max_fee_ppm = 250
5. Now, we need to find the IP of your docker.
Run this command:
sudo nano ~/umbrel/.env
Find the line with LND_IP in it, and copy that IP address. Exit without saving.
6. Run the docker
The way charge-lnd works is by running the container “one time” - rather than keeping it open and alive persistently. This is different from other docker installations that Umbrel uses, but it doesn’t matter. We can ask our Pi to run the docker from the files hosted on the web.
First, make sure that you are in the right directory…
Now, create the docker w/ the file you’ve already created as the config file. Don’t forget to replace the IP address with the one you found above.
docker run --rm -it --network=umbrel_main_network \ -e GRPC_LOCATION=LND.IP.ADDRESS.GOES.HERE:10009 \ -e LND_DIR=/data/.lnd \ -e CONFIG_LOCATION=/app/charge.config \ -v /home/umbrel/umbrel/lnd:/data/.lnd \ -v /mnt/data/upgrades/charge-lnd/charge.config:/app/charge.config \ accumulator/charge-lnd:latest
If everything works as expected, you’ll see a list of all of your channels, and the changes that have been made according to your rules / policies.
Check that you’re happy with how it’s applying rules.
If not, go ahead and edit the charge.config file on your hard disk that we created, then run the above “run” command again.
7. Now, Automate it!
Once you’re happy with everything, you can optionally set up a “crontab” job to automatically run this command every X minutes or hours.
The system will create a new crontab file, since none exists.
In this file, you can put the following, all on one line (make sure to update the IP address in this to yours):
0 * * * * docker run --rm --network=umbrel_main_network -e GRPC_LOCATION=YOUR.LND.IP.ADDRESS:10009 -e LND_DIR=/data/.lnd -e CONFIG_LOCATION=/app/charge.config -v /home/umbrel/umbrel/lnd:/data/.lnd -v /mnt/data/upgrades/charge-lnd/charge.config:/app/charge.config accumulator/charge-lnd:latest
This will run your charge-lnd script once every hour. This is the maximum recommended frequency by charge-lnd, as running it more frequently can result in failed routes or other confusion and chatter on the network.
If you wish to run it more/less frequently, that’s up to you, and you can find the instructions for changing the
0 * * * * part of the command above here: https://crontab.guru
If you’ve followed the steps above correctly, everything should work just fine, and update your routing policies every hour on the hour.
This guide was created with the help and support of a LOT of people MUCH smarter than me - and of course, it leverages the awesome (and free) script written by accumulator - so make sure to support their work.
With that said, if you appreciate this guide and would like to see me create MORE guides like this, you’re welcome to tip myself or any of the folks who helped me using Telegram @LNTXBot:
/tip 100 @The_Lorax_LN
/tip 100 @jorijn
/tip 100 @yuvadm
Thanks for reading, I hope you enjoyed this guide.
EDIT: Removed docker login, it’s no longer necessary