Ride the Lightning

Time: 15 minutes

The Lightning Network CLI is kinda fun, but not very practical. That's why we're installing Ride The Lightning (RTL). A user-unfriendly front end for LND.

Note that this section is dependent on the NodeJS installation. You cannot proceed if you do not have NodeJS installed on the Raspberry Pi.

Installation

First, it's time to fetch the source code from RTL.

git clone https://github.com/Ride-The-Lightning/RTL

Dive into the code.

cd RTL

Grab the latest version/tag/release.

git checkout v0.14.1

Now install RTL. Note that this may take about 10 minutes.

npm install --only=prod

Configuration

RTL also needs to be configured. Create the configuration file (still in the /home/ubuntu/RTL folder).

nano RTL-Config.json

Paste this into it.

{
"multiPass": "password",
"port": "3000",
"defaultNodeIndex": 1,
"SSO": {
"rtlSSO": 0,
"rtlCookiePath": "",
"logoutRedirectLink": ""
},
"nodes": [
{
"index": 1,
"lnNode": "YOUR_ALIAS",
"lnImplementation": "LND",
"Authentication": {
"macaroonPath": "/home/ubuntu/.lnd/data/chain/bitcoin/mainnet",
"configPath": "/home/ubuntu/.lnd/lnd.conf"
},
"Settings": {
"userPersona": "OPERATOR",
"themeMode": "NIGHT",
"themeColor": "TEAL",
"bitcoindConfigPath": "/home/ubuntu/.bitcoin/bitcoin.conf",
"enableLogging": true,
"fiatConversion": false,
"lnServerUrl": "https://127.0.0.1:8080"
}
}
]
}

At YOUR_ALIAS, enter the alias of your Lightning node. Save it with Ctrl + X and confirm with Y.

Firewall

Open port 3000.

sudo ufw allow 3000 comment "Port for Ride the Lightning"

Should you wish to use RTL from outside your network, you must throw open port 3000 on your router and forward traffic to your Pi.

Automation

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

Paste this.

[Unit]
Description=Ride The Lightning Daemon
Requires=lnd.service
After=lnd.service
[Service]
User=ubuntu
ExecStart=/usr/bin/node /home/ubuntu/RTL/rtl.js
Restart=always
TimeoutSec=120
RestartSec=30
[Install]
WantedBy=multi-user.target

Save it again with Ctrl + X and confirm with Y.

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

sudo systemctl enable rtl
sudo systemctl start rtl

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

systemctl status rtl

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

sudo journalctl -f -u rtl

Use

Using your favorite browser, go to the ip address of your Pi:3000. In my case, it is 192.168.1.6:3000. The RTL interface will appear and ask for a password. The default password is "password". After the first login, you may set your own password. If LND has just been started, RTL will also ask for that password (the lncli unlock password).

Updating

Go to the application directory.

cd ~/RTL

Update the repository with the latest changes via Git.

git fetch --all

Show the latest version/tag/release.

git describe --tags `git rev-list --tags --max-count=1`

Retrieve the changes from the latest release.

git checkout -f <OUTPUT FROM PREVIOUS STEP> # for example v0.14.1

Install the software.

npm install --only=prod

Restart the RTL service.

sudo systemctl restart rtl

RTL is now updated!