RTLprereqs: running and synced bitcoin core, running lightningd (c-lightning)step 1: make sure you're user bitcoin, make sure you're in the home folder, install the prereqs
whoami
pwd
cd ~
sudo yum install -y gcc-c++ make
sudo curl -sL https://rpm.nodesource.com/setup_12.x | sudo -E bash -
sudo yum install nodejs
step 2: clone and build c-lightning-REST (this is a prereq for RTL)
git clone https://github.com/saubyk/c-lightning-REST
cd c-lightning-REST
npm install
cp sample-cl-rest-config.json cl-rest-config.json
sudo lsof -i :3001
sudo lsof -i :4001
if the lsof command return nothing, the cl-rest-config.json should not be edited, if an other service is listening to port 3001 or 4001, you'll need to edit cl-rest-config.json
step 3: create a service file for c-lightning-REST
sudo nano /etc/systemd/system/c-lightning-REST.service
step 4: fill c-lightning-REST.service
[Unit]
Description=c-lightning-REST daemon
Wants=lightningd.service
After=lightningd.service
[Service]
ExecStart=/usr/bin/node /home/bitcoin/c-lightning-REST/cl-rest.js
User=bitcoin
Group=bitcoin
Restart=always
TimeoutSec=120
RestartSec=30
[Install]
WantedBy=multi-user.target
step 5: enable and start the service
sudo systemctl enable c-lightning-REST.service
sudo service c-lightning-REST start
step 6: make sure you're back into your home folder
cd ~
step 7: clone and build RTL
git clone https://github.com/Ride-The-Lightning/RTL.git
cd RTL
npm install
cp sample-RTL-Multi-Node-Conf.json RTL-Multi-Node-Conf.json
step 8: edit RTL-Multi-Node-Conf.json
{
"multiPass": "very_strong_password",
"port": "3000",
"defaultNodeIndex": 1,
"SSO": {
"rtlSSO": 0,
"rtlCookiePath": "",
"logoutRedirectLink": ""
},
"nodes": [
{
"index": 1,
"lnNode": "C Lighting",
"lnImplementation": "CLT",
"Authentication": {
"macaroonPath": "/home/bitcoin/c-lightning-REST/certs/"
},
"Settings": {
"userPersona": "MERCHANT",
"themeMode": "NIGHT",
"themeColor": "TEAL",
"channelBackupPath": "/home/bitcoin/RTL/",
"bitcoindConfigPath": "/home/bitcoin/.bitcoin/",
"enableLogging": true,
"fiatConversion": false,
"lnServerUrl": "https://127.0.0.1:3001/v1"
}
}
]
step 9: create service file
sudo nano /etc/systemd/system/RTL.service
step 10: fill RTL.service
[Unit]
Description=RTL daemon
Wants=c-lightning-REST.service
After=c-lightning-REST.service
[Service]
ExecStart=/usr/bin/node /home/bitcoin/RTL/rtl.js
User=bitcoin
Group=bitcoin
Restart=always
TimeoutSec=120
RestartSec=30
[Install]
WantedBy=multi-user.target
step 11: enable and start RTL service
sudo systemctl enable RTL.service
sudo service RTL start
At this point, you have RTL up and running... If you surf to https://127.0.0.1:3000 you'll be able to login and manage your lightning node.
HOWEVER, if you've installed RTL on a server without a desktop environment and/or without proper x server forewarding, you'll need to execute the following steps in order to be able to surf to RTL (the RTL daemon only listens on localhost port 3000, so i't not accessible on an external portstep 1: register a tld. If you don't want to spend any money, a .tk domain is free. Make sure there's an a-record for this domain that points to your server. If you really don't have a domain, contact me and i'll give you a free [yourname].mocacinno.com subdomain
step 2: request a certificate for this domain using certbot
sudo yum install nginx certbot
sudo certbot certonly
step 3: open nginx.conf
nano /etc/nginx/nginx.conf
step 4: edit nginx.conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
stream {
upstream RTL {
server 127.0.0.1:3000;
}
server {
listen 3002 ssl;
proxy_pass RTL;
ssl_certificate /etc/letsencrypt/live/yourdomain.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.tld/privkey.pem;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 4h;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
}
}
step 5: restart nginx
sudo service nginx restart
step 6: you now have RTL up and running:
https://yourdomain.tld:3002