Ligess

Time: 20 minutes

With Ligess, you configure your own lightning address server connected to your node. Learn more in the Github repository.

Requirements

Installation

Go to your home directory.

cd ~

Download the source code and clone the Git repository.

git clone https://github.com/dolu89/ligess

Go to the code.

cd ~/ligess

Install Ligess.

npm install

Make a copy of the .env.example file and rename this copy to .env.

cp .env.example .env

Edit this file with your .env variables.

nano .env

Save the file with Ctrl + X and confirm with Y.

Example:

LIGESS_USERNAME=your_name
LIGESS_DOMAIN=yourdomain.com
LIGESS_LN_BACKEND=LND
LIGESS_LND_REST=https://0.0.0.0:8080
LIGESS_LND_MACAROON=[...]
HOST=127.0.0.1
PORT=8088

At LIGESS_LND_MACAROON you need to place a hex encoded macaroon where the example reads [...]. To create a macaroon in hex format you can use https://github.com/ZeusLN/lnd-hex-macaroon-generator. If you have this tool installed, use it as follows:

node index.js
> /home/ubuntu/.lnd/data/chain/bitcoin/mainnet/backup/invoice.macaroon

You enter the output at LIGESS_LND_MACAROON in .env.

Firewall

Open port 8088.

sudo ufw allow 8088 comment "Ligess"

Your lightning address now looks like this: your_name@yourdomain.com

Test whether Ligess works by launching the application:

yarn dev

Next, open this link in your browser: http://localhost:8088/.well-known/lnurlp/jouw_naam

Automation

sudo nano /etc/systemd/system/ligess.service

Paste in the following.

[Unit]
Description=Ligess
Requires=lnd.service
After=lnd.service
[Service]
User=ubuntu
WorkingDirectory=/home/ubuntu/ligess
ExecStart=yarn dev
Restart=always
TimeoutSec=120
RestartSec=30
[Install]
WantedBy=multi-user.target

Save the file with Ctrl + X and confirm with Y.

The system must be notified of the new service and can then be started.

sudo systemctl enable ligess
sudo systemctl start ligess

If you want to see if everything started up properly, run this:

systemctl status ligess

If you want an overview of the status over multiple session, use this:

sudo journalctl -f -u ligess

Nginx reverse proxy

Locally, your setup should now work, but your lightning address is not yet reachable from the outside. For that you can use this Nginx reverse proxy setup.

upstream lnurlp {
server 127.0.0.1:8088;
}
server {
server_name yourdomain.com;
listen [::]:443 ssl http2; # managed by Certbot
listen 443 ssl http2; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
location /.well-known/lnurlp/ {
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*';
}
proxy_pass http://lnurlp;
}
}
server {
if ($host = yourdomain.com) {
return 301 https://$host$request_uri;
}
server_name yourdomain.com;
listen 80;
listen [::]:80;
return 404;
}

Updating

Go to the application directory.

cd ~/ligess

Update the repository with the latest changes via Git.

git fetch --all
git pull

Install the software.

npm install

Restart the Ligess service.

sudo systemctl restart ligess

Ligess is now updated!

Usage

To use your own lightning address you need to use a wallet that supports it. A complete list can be found here.

You can also test/decode your lightning address at https://lightningdecoder.com where you can enter jouw_naam@jouwdomein.com at Enter Invoice.