I've tested this script and workflow on Umbrel, and it works. See resource/credit at the end.
ssh -t umbrel@umbrel.local
, and login with your password
Read more about charge-lnd here.
First step is to create charge-lnd config/policy file charge-lnd.config
, and put it in /mnt/data/umbrel/app-data/lightning-shell/data
Type: sudo nano /mnt/data/umbrel/app-data/lightning-shell/data/charge-lnd.config
(retype your password if asked on prompt)
here's my config file for example
On Umbrel, open Lightning Shell (install it first via Umbrel app store).
To check whether the syntax on your policy is valid, type: charge-lnd --config /data/charge-lnd.config --check
if it return Configuration file is valid
, your config file is ready to go.
additional step is to run --dry-run
to test the policy without applying it, type:
charge-lnd --config /data/charge-lnd.config --dry-run
if it works, it will return one of your channels that adjusted based on your policy/config file.
type cd ~
, then crontab -e
to create new cron file.
In the editor, type: 0 * * * * (docker exec -u lnshell -w /home/lnshell lightning-shell_web_1 /home/lnshell/.local/bin/charge-lnd --config /data/charge-lnd.config) 2>&1 | logger -t charge-lnd
to set it trigger every hour.
Change the interval based on your need, learn more https://crontab.guru/
exit the editor by type ctrl + x
, save it, and it will starts triggering every hour from now on.
type: cd /var/log
and then nano syslog
. It will open nano editor, scroll down to recent log. If it works, you can see log item with title charge-lnd
on it.
I combined snippets from these resources:
https://community.getumbrel.com/t/guide-installing-charge-lnd-in-a-docker-to-automate-your-fee-policies/2187
https://gist.github.com/msimion/e756bbe95426a91d7a0aa9912c7d0619
https://community.getumbrel.com/t/running-charge-lnd-with-cron-from-lnshell/6207/2
Thanks - works on Umbrel