Fix LNDg install & update v1.8.0 (#4498)

This commit is contained in:
/rootzoll 2024-03-25 14:17:13 +01:00 committed by rootzoll
parent 27ff2d63e2
commit 01db973bec
2 changed files with 13 additions and 75 deletions

View file

@ -23,10 +23,10 @@
- Update: Channel Tools (chantools) v0.12.0 [details](https://github.com/lightninglabs/chantools/releases/tag/v0.12.0) - Update: Channel Tools (chantools) v0.12.0 [details](https://github.com/lightninglabs/chantools/releases/tag/v0.12.0)
- Update: LNbits 0.11.3 [details](https://github.com/lnbits/lnbits/releases/tag/0.11.3) - Update: LNbits 0.11.3 [details](https://github.com/lnbits/lnbits/releases/tag/0.11.3)
- Update: Circuitbreaker v0.5.1 [details](https://github.com/lightningequipment/circuitbreaker/blob/master/README.md) - Update: Circuitbreaker v0.5.1 [details](https://github.com/lightningequipment/circuitbreaker/blob/master/README.md)
- Update: LNDg v1.8.0 [details](https://github.com/cryptosharks131/lndg/releases/tag/v1.8.0)
- Experimental: LNDK (runs on top of LND to help forward onion messages (BOLT 12)) [details](https://github.com/lndk-org/lndk) - Experimental: LNDK (runs on top of LND to help forward onion messages (BOLT 12)) [details](https://github.com/lndk-org/lndk)
- Fix: PyBlock 2.2.3 [details](https://github.com/curly60e/pyblock/blob/master/README.md) - Fix: PyBlock 2.2.3 [details](https://github.com/curly60e/pyblock/blob/master/README.md)
- Refactor: Wifi config with file on sd card - Refactor: Wifi config with file on sd card
- Deactivated for Repair: LNDg [details](https://github.com/raspiblitz/raspiblitz/issues/4418)
- Deactivated for Repair: lnproxy [details](https://github.com/raspiblitz/raspiblitz/issues/4122) - Deactivated for Repair: lnproxy [details](https://github.com/raspiblitz/raspiblitz/issues/4122)
- Deprecated: Homer Dashboard (remove from SSH menus, config script will stay with possible future removal) - Deprecated: Homer Dashboard (remove from SSH menus, config script will stay with possible future removal)
- Deprecated: Bitcoinminds (remove from SSH menus, config script will stay with possible future removal) - Deprecated: Bitcoinminds (remove from SSH menus, config script will stay with possible future removal)

View file

@ -154,8 +154,6 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-) PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-)
echo "# LNDg initialize.py ..." echo "# LNDg initialize.py ..."
sudo -u lndg .venv/bin/python initialize.py -pw $PASSWORD_B sudo -u lndg .venv/bin/python initialize.py -pw $PASSWORD_B
echo "# LNDg jobs.py ..."
sudo -u lndg .venv/bin/python jobs.py
echo "# LNDg database ..." echo "# LNDg database ..."
@ -303,87 +301,29 @@ WantedBy=multi-user.target
sudo ufw allow from any to any port 8888 comment 'allow LNDg HTTPS' sudo ufw allow from any to any port 8888 comment 'allow LNDg HTTPS'
echo "" echo ""
################## ############################
# SYSTEMD SERVICE # SYSTEMD CONTROLLER SERVICE
################## ############################
echo "# Install LNDg systemd for ${network} on ${chain}" echo "# Install LNDg systemd for ${network} on ${chain}"
echo " echo "
#!/bin/bash
/home/lndg/lndg/.venv/bin/python /home/lndg/lndg/jobs.py
" | sudo tee /home/lndg/lndg/jobs.sh
echo "
#!/bin/bash
/home/lndg/lndg/.venv/bin/python /home/lndg/lndg/rebalancer.py
" | sudo tee /home/lndg/lndg/rebalancer.sh
echo "
#!/bin/bash
/home/lndg/lndg/.venv/bin/python /home/lndg/lndg/htlc_stream.py
" | sudo tee /home/lndg/lndg/htlc_stream.sh
echo "
[Unit] [Unit]
Description=Run Jobs For Lndg Description=Backend Controller For Lndg
[Service] [Service]
Environment=PYTHONUNBUFFERED=1
User=lndg User=lndg
Group=lndg Group=lndg
ExecStart=/bin/bash /home/lndg/lndg/jobs.sh ExecStart=/home/lndg/lndg/.venv/bin/python /home/lndg/lndg/controller.py
StandardError=append:/var/log/lnd_jobs_error.log StandardOutput=append:/var/log/lndg-controller.log
" | sudo tee /etc/systemd/system/jobs-lndg.service StandardError=append:/var/log/lndg-controller.log
echo "
[Unit]
Description=Run Rebalancer For Lndg
[Service]
User=lndg
Group=lndg
ExecStart=/bin/bash /home/lndg/lndg/rebalancer.sh
StandardError=append:/var/log/lnd_rebalancer_error.log
RuntimeMaxSec=3600
" | sudo tee /etc/systemd/system/rebalancer-lndg.service
echo "
[Unit]
Description=Run HTLC Stream For Lndg
Requires=lnd.service
After=lnd.service
[Service]
User=lndg
Group=lndg
ExecStart=/bin/bash /home/lndg/lndg/htlc_stream.sh
StandardError=append:/var/log/lnd_htlc_stream_error.log
Restart=always Restart=always
RestartSec=60s RestartSec=60s
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
" | sudo tee /etc/systemd/system/htlc-stream-lndg.service " | sudo tee /etc/systemd/system/lndg-controller.service
echo "
[Unit]
Description=Run Lndg Jobs Every 20 Seconds
[Timer]
OnBootSec=300
OnUnitActiveSec=20
AccuracySec=1
[Install]
WantedBy=timers.target
" | sudo tee /etc/systemd/system/jobs-lndg.timer
echo "
[Unit]
Description=Run Lndg Rebalancer Every 20 Seconds
[Timer]
OnBootSec=315
OnUnitActiveSec=20
AccuracySec=1
[Install]
WantedBy=timers.target
" | sudo tee /etc/systemd/system/rebalancer-lndg.timer
sudo systemctl enable jobs-lndg.timer
sudo systemctl enable rebalancer-lndg.timer
sudo systemctl enable htlc-stream-lndg.service
sudo systemctl start jobs-lndg.timer
sudo systemctl start rebalancer-lndg.timer
sudo systemctl start htlc-stream-lndg.service
sudo systemctl enable lndg-controller
sudo systemctl start lndg-controller
# setting value in raspiblitz config # setting value in raspiblitz config
/home/admin/config.scripts/blitz.conf.sh set lndg "on" /home/admin/config.scripts/blitz.conf.sh set lndg "on"
@ -408,9 +348,7 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
echo "*** REMOVING LNDG ***" echo "*** REMOVING LNDG ***"
# remove systemd services # remove systemd services
sudo systemctl disable jobs-lndg.timer sudo systemctl disable lndg-controller
sudo systemctl disable rebalancer-lndg.timer
sudo systemctl disable htlc-stream-lndg.service
sudo systemctl disable gunicorn.service sudo systemctl disable gunicorn.service
sudo rm -f /etc/systemd/system/jobs-lndg.timer sudo rm -f /etc/systemd/system/jobs-lndg.timer
sudo rm -f /etc/systemd/system/rebalancer-lndg.timer sudo rm -f /etc/systemd/system/rebalancer-lndg.timer