LNDg Install Guide

This page summarizes the projects mentioned and recommended in the original post on /r/raspibolt

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • lndg

    Lite GUI web interface to analyze lnd data and leverage the backend database for automation tools around rebalancing and other basic maintenance tasks.

  • Configure firewall for LNDg ============================== $ sudo ufw allow 8889/tcp comment 'allow LNDg SSL' $ sudo ufw status Install python and uwsgi ======================== $ sudo apt install -y python3-dev build-essential python virtualenv uwsgi Create user account for LNDg ============================ $ sudo adduser --disabled-password --gecos "" lndg $ sudo usermod -a -G lnd lndg $ sudo usermod -a -G www-data lndg $ sudo su - lndg $ ln -s /data/lnd /home/lndg/.lnd Install LNDg ============ $ git clone https://github.com/cryptosharks131/lndg.git $ cd lndg $ virtualenv -p python3 .venv $ .venv/bin/pip install -r requirements.txt $ .venv/bin/python initialize.py (Make sure lnd has started) $ .venv/bin/python jobs.py (Creates initial data set) (Start development server) $ .venv/bin/python manage.py runserver 0.0.0.0:8889 (Check site at http://X.X.X.X:8889 Login:lndg-admin Password:/home/lndg/lndg/data/lndg-admin.txt ctrl-c to exit) $ .venv/bin/python -m pip install uwsgi (If install fails, uninstall and try again: $ .venv/bin/python -m pip uninstall uwsgi) Create ini file =============== $ vi /home/lndg/lndg/lndg.ini (Paste below) # lndg.ini file [uwsgi] # Django-related settings # the base directory (full path) chdir = /home/lndg/lndg # Django's wsgi file module = lndg.wsgi # the virtualenv (full path) home = /home/lndg/lndg/.venv #location of log files logto = /var/log/uwsgi/%n.log # process-related settings # master master = true # maximum number of worker processes processes = 1 # the socket (use the full path to be safe socket = /home/lndg/lndg/lndg.sock # ... with appropriate permissions - may be needed chmod-socket = 660 # clear environment on exit vacuum = true Create uwsgi parameter file =========================== $ vi /home/lndg/lndg/uwsgi_params (Paste below) uwsgi_param QUERY_STRING $query_string; uwsgi_param REQUEST_METHOD $request_method; uwsgi_param CONTENT_TYPE $content_type; uwsgi_param CONTENT_LENGTH $content_length; uwsgi_param REQUEST_URI "$request_uri"; uwsgi_param PATH_INFO "$document_uri"; uwsgi_param DOCUMENT_ROOT "$document_root"; uwsgi_param SERVER_PROTOCOL "$server_protocol"; uwsgi_param REQUEST_SCHEME "$scheme"; uwsgi_param HTTPS "$https if_not_empty"; uwsgi_param REMOTE_ADDR "$remote_addr"; uwsgi_param REMOTE_PORT "$remote_port"; uwsgi_param SERVER_PORT "$server_port"; uwsgi_param SERVER_NAME "$server_name"; Create uwsgi service ==================== $ exit (return to admin account) $ sudo vi /etc/systemd/system/uwsgi.service (Paste below) [Unit] Description=Lndg uWSGI app [Service] ExecStart=/home/lndg/lndg/.venv/bin/uwsgi --ini /home/lndg/lndg/lndg.ini User=lndg Group=www-data Restart=on-failure KillSignal=SIGQUIT Type=notify StandardError=syslog NotifyAccess=all [Install] WantedBy=sockets.target Configure LNDg nginx site ========================= $ sudo vi /etc/nginx/sites-available/lndg-ssl.conf (Paste below) upstream django { server unix:///home/lndg/lndg/lndg.sock; # for a file socket } server { # the port your site will be served on, use port 80 unless setting up ssl certs, then 443 listen 8889 ssl; listen [::]:8889 ssl; ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt; ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key; ssl_session_timeout 4h; ssl_protocols TLSv1.3; ssl_prefer_server_ciphers on; # the domain name it will serve for server_name _; # you can substitute your node IP address or a custom domain like lndg.local (just make sure to update your local hosts file) charset utf-8; # max upload size client_max_body_size 75M; # adjust to taste # max wait for django time proxy_read_timeout 180; # Django media location /static { alias /home/lndg/lndg/gui/static; # your Django project's static files - amend as required } # Finally, send all non-media requests to the Django server. location / { uwsgi_pass django; include /home/lndg/lndg/uwsgi_params; # the uwsgi_params file } } Enable site and create log and sock files ========================================= $ sudo ln -sf /etc/nginx/sites-available/lndg-ssl.conf /etc/nginx/sites-enabled/ $ sudo touch /var/log/uwsgi/lndg.log $ sudo chgrp www-data /var/log/uwsgi/lndg.log $ sudo chmod 660 /var/log/uwsgi/lndg.log $ sudo touch /home/lndg/lndg/lndg.sock $ sudo chown lndg:www-data /home/lndg/lndg/lndg.sock $ sudo chmod 660 /home/lndg/lndg/lndg.sock $ sudo nginx -t $ sudo systemctl enable nginx (It should have been enabled during installation, this is just to make sure.) $ sudo systemctl enable uwsgi $ sudo systemctl start uwsgi $ sudo journalctl -f -u uwsgi $ sudo systemctl restart nginx (Test site at https://X.X.X.X:8889) Update admin password ===================== https://X.X.X.X:8889/lndg-admin Notes ===== If you run into the '502 Bad Gateway': 1) Make sure all other services (especially LND) have fully started. This can take some time if you have extras installed. 2) Restart the uwsgi service. a) $ sudo systemctl restart uwsgi 3) Retest the secure site: https://X.X.X.X:8889 If you have other issues connecting to Nginx, double check your config file. 1) $ sudo vi /etc/nginx/nginx.conf Make sure it matches what RaspiBolt recommends. 1) https://raspibolt.org/guide/raspberry-pi/security.html#prepare-nginx-reverse-proxy Enable LNDg jobs ================ $ sudo vi /home/lndg/lndg/jobs.sh (Paste below) #!/bin/bash /home/lndg/lndg/.venv/bin/python /home/lndg/lndg/jobs.py $ sudo chown lndg:lndg /home/lndg/lndg/jobs.sh $ sudo vi /etc/systemd/system/lndg-jobs.service (Paste below) [Unit] Description=Run Jobs For Lndg [Service] User=lndg Group=lndg ExecStart=/usr/bin/bash /home/lndg/lndg/jobs.sh StandardError=append:/var/log/lnd_jobs_error.log $ sudo vi /etc/systemd/system/lndg-jobs.timer (Paste below) [Unit] Description=Run Lndg Jobs Every 20 Seconds [Timer] OnBootSec=300 OnUnitActiveSec=20 AccuracySec=1 [Install] WantedBy=timers.target $ sudo systemctl enable lndg-jobs.timer $ sudo systemctl start lndg-jobs.timer $ sudo systemctl status lndg-jobs.timer $ sudo journalctl -f -u lndg-jobs (Verify service is running) Enable LNDg Rebalancer ====================== $ sudo vi /home/lndg/lndg/rebalancer.sh (Paste below) #!/bin/bash /home/lndg/lndg/.venv/bin/python /home/lndg/lndg/rebalancer.py $ sudo chown lndg:lndg /home/lndg/lndg/rebalancer.sh $ sudo vi /etc/systemd/system/lndg-rebalancer.service (Paste below) [Unit] Description=Run Rebalancer For Lndg [Service] User=lndg Group=lndg ExecStart=/usr/bin/bash /home/lndg/lndg/rebalancer.sh StandardError=append:/var/log/lnd_rebalancer_error.log RuntimeMaxSec=3600 $ sudo vi /etc/systemd/system/lndg-rebalancer.timer (Paste below) [Unit] Description=Run Lndg Rebalancer Every 20 Seconds [Timer] OnBootSec=315 OnUnitActiveSec=20 AccuracySec=1 [Install] WantedBy=timers.target $ sudo systemctl enable lndg-rebalancer.timer $ sudo systemctl start lndg-rebalancer.timer $ sudo systemctl status lndg-rebalancer.timer $ sudo journalctl -f -u lndg-rebalancer (Verify service is running) Enable LNDg HTLC Failure Stream Data ==================================== $ sudo vi /home/lndg/lndg/htlc_stream.sh (Paste below) #!/bin/bash /home/lndg/lndg/.venv/bin/python /home/lndg/lndg/htlc_stream.py $ sudo chown lndg:lndg /home/lndg/lndg/htlc_stream.sh $ sudo vi /etc/systemd/system/lndg-htlc-stream.service [Unit] Description=Run HTLC Stream For Lndg [Service] User=lndg Group=lndg ExecStart=/usr/bin/bash /home/lndg/lndg/htlc_stream.sh StandardError=append:/var/log/lnd_htlc_stream_error.log Restart=on-failure RestartSec=60s [Install] WantedBy=multi-user.target $ sudo systemctl enable lndg-htlc-stream $ sudo systemctl start lndg-htlc-stream $ sudo systemctl status lndg-htlc-stream $ sudo journalctl -f -u lndg-htlc-stream (Verify service is running)

  • RaspiBolt

    Bitcoin & Lightning full node on a Raspberry Pi (by VajraOfIndra)

  • I was working on a LNDg guide as well for the RaspiBolt (https://github.com/VajraOfIndra/RaspiBolt/blob/LNDg/guide/bonus/lightning/lndg.md), but it's using clearnet for now, as I didn't manage to use nginx as a reverse proxy (the browser was throwing up an error message due to a missing cert or something).

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Firefox Enables Screen Wake Lock API by Default – Again

    1 project | news.ycombinator.com | 20 May 2024
  • ZenVer: A post-modern versioning scheme that does not suck

    1 project | news.ycombinator.com | 13 May 2024
  • Windows 10 Inbox Apps | Offline WIM Servicing

    2 projects | /r/sysadmin | 30 Jun 2022
  • Objective-C Implementations in Swift

    1 project | news.ycombinator.com | 10 May 2024
  • Objective-C Implementations in Swift

    1 project | news.ycombinator.com | 8 May 2024