Ride The Lightning (RTL) GUII will preface the RTL install instruction: it is not required to run and manage C-Lightning nodes, but it makes a lot of things a lot simpler. And of course it's graphical opposed to the purely command-line based C-Lightning interface. Unfortunately, it is based on
NodeJS, which many people find is bloated, that should also be kept in mind. So unless you need it, you can omit RTL in the beginning.
Also another remark: You can install c-lightning-REST as a C-Lightning
plugin, which is a pretty cool feature of C-Lightning (ability to add features as plugins), however I recommend installing as services, since it makes it easier to restart them without restarting C-Lightning all the time (which is not optimal).
Part 1: Installing the backend - c-lightning-REST[1] Install dependencies
Check out the latest non-development
nodejs version in the package manager:
sudo zypper search nodejs
At the time of writing, it is version 16.
S | Name | Summary | Type
--+-------------------------+--------------------------------------------+-----------
| nodejs-common | Common files for the NodeJS ecosystem | package
| nodejs-default | Default version of nodejs | package
| nodejs-devel-default | Headers for default version of nodejs | package
| nodejs-emojione | A set of emojis designed for the web | package
| nodejs-emojione-awesome | Emojione templates | package
| nodejs-emojione-demo | EmojiOne Demos | package
| nodejs-emojione-meteor | EmojiOne utility for Meteor | package
| nodejs-emojione-python | EmojiOne utility for Python | package
| nodejs-emojione-swift | EmojiOne utility for swift | package
| nodejs-packaging | Node.js Dependency generators for openSUSE | package
| nodejs-underscore | A utility belt library for JavaScript | package
| nodejs10 | Evented I/O for V8 JavaScript | package
| nodejs10 | Evented I/O for V8 JavaScript | srcpackage
| nodejs10-devel | Development headers for NodeJS 10.x | package
| nodejs10-docs | Node.js API documentation | package
| nodejs12 | Evented I/O for V8 JavaScript | package
| nodejs12 | Evented I/O for V8 JavaScript | srcpackage
| nodejs12-devel | Development headers for NodeJS 12.x | package
| nodejs12-docs | Node.js API documentation | package
| nodejs14 | Evented I/O for V8 JavaScript | package
| nodejs14 | Evented I/O for V8 JavaScript | srcpackage
| nodejs14-devel | Development headers for NodeJS 14.x | package
| nodejs14-docs | Node.js API documentation | package
| nodejs16 | Evented I/O for V8 JavaScript | srcpackage
| nodejs16 | Evented I/O for V8 JavaScript | package
| nodejs16-devel | Development headers for NodeJS 16.x | package
| nodejs16-docs | Node.js API documentation | package
| nodejs8 | Evented I/O for V8 JavaScript | package
| nodejs8 | Evented I/O for V8 JavaScript | srcpackage
| nodejs8-devel | Development headers for NodeJS 8.x | package
| nodejs8-docs | Node.js API documentation | package
Install the non-development version.
sudo zypper install nodejs16
[2] While still in your privileged user, check if ports 3001 and 4001 are already in use (shouldn't be), as follows. If the commands return nothing, you're clear.
sudo lsof -i :3001
sudo lsof -i :4001
Otherwise, try other high port numbers. Best would be to refer to
Wikipedia to make sure you're not going to conflict with another webservice of sorts on your machine. Again try with the
sudo lsof -i[tt/] command as shown and note two ports of your choice.
[3] Clone the c-lightning-REST repository and check out the latest version.
su - bitcoin
git clone https://github.com/Ride-The-Lightning/c-lightning-REST.git
cd c-lightning-REST
git checkout v0.10.4
[4] Install this version in 'production' mode.
[5] Create new config file from sample config and leave all values on their defaults for now.
cp sample-cl-rest-config.json cl-rest-config.json
[6] If you got an issue in step 2 with ports 3001 and / or 4001 already in use, open the file
cl-rest-config.json now and change the values to the ones you chose and verified were clear to use. Otherwise you can skip this step.
[7] Log out of unprivileged
bitcoin account and create a service file.
exit
sudo nano /usr/lib/systemd/system/c-lightning-REST.service
[8] Add the following contents:
[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
WorkingDirectory=/home/bitcoin/c-lightning-REST
User=bitcoin
Group=users
Restart=always
TimeoutSec=120
RestartSec=30
[Install]
WantedBy=multi-user.target
[9] Enable and start the c-lightning-REST service.
sudo systemctl enable c-lightning-REST.service
sudo service c-lightning-REST start
[10] Check that the service is running and everything's fine so far. Exit by just typing the letter
Q.
sudo service c-lightning-REST status
Part 2: Installing the frontend - RTL[1] Change back into unprivileged
bitcoin user and clone the repository. Also going to check out the latest release.
su - bitcoin
git clone https://github.com/Ride-The-Lightning/RTL.git
cd RTL
git checkout v0.14.0
[2] Install
requests dependency and RTL in production mode.
npm install request --save
npm install --only=prod --legacy-peer-deps
[3] Create a new configuration file and open it up.
[4] Enter the following.
{
"multiPass": "password",
"port": "3000",
"SSO": {
"rtlSSO": 0,
"rtlCookiePath": "",
"logoutRedirectLink": ""
},
"nodes": [
{
"index": 1,
"lnNode": "c-lightning",
"lnImplementation": "CLT",
"Authentication": {
"macaroonPath": "/home/bitcoin/c-lightning-REST/certs/"
},
"Settings": {
"userPersona": "OPERATOR",
"themeMode": "NIGHT",
"themeColor": "PURPLE",
"channelBackupPath": "/home/bitcoin/RTL/",
"bitcoindConfigPath": "/home/bitcoin/.bitcoin/",
"logLevel": "INFO",
"fiatConversion": false,
"lnServerUrl": "https://127.0.0.1:3001/v1"
}
}
]
}
[5] Change to privileged account to create a new service file for RTL.
exit
sudo nano /usr/lib/systemd/system/RTL.service
[6] Enter the following.
[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=users
Restart=always
TimeoutSec=120
RestartSec=30
[Install]
WantedBy=multi-user.target
[7] Activate and install the service.
sudo systemctl enable RTL.service
sudo service RTL start
[8] Make sure the service is up and running correctly.
[9] If you just want to access RTL on the node itself, visit a web browser and type
localhost:3000. Otherwise, either open port 3000 to access the node in your local network or proceed with the next step to tunnel this again through Tor!
[10] Open
torrc and add the following below the previously installed Tor hidden services.
HiddenServiceDir /var/lib/tor/rtl_hidden_service/
HiddenServiceVersion 3
HiddenServicePort 3000 127.0.0.1:3000
[11] Restart Tor and retrieve the Tor URL for RTL.
sudo service tor restart
sudo cat /var/lib/tor/rtl_hidden_service/hostname
[12] You can now access
Ride The Lightning from anywhere through Tor Browser, on Desktop and even Mobile!
Simply type in the
[mumbojumbo].onion:3000 address from step 11. Highly recommend to bookmark it or otherwise save it, since you can't probably memorize it!
[13]
VERY IMPORTANT! Changing the password. By default, it is
password. Change it to something secure and add 2FA through an open-source 2FA application (not Google Authenticator).
Part 3 (optional): HardeningThis is a version 3 hidden service, so it cannot be found in any way unlike servers in the clearnet or Tor v2. You also have authentication within RTL. If you don't deem this secure enough though, you can set up client authentication, which involves generating a shared secret and setting it up on both the node and the client (Tor browser or Tor service on client computer).
I am not trying this, since I find Onion v3 addresses good enough, especially when paired with a secure password and 2FA code.
If you still want it (e.g. multiple BTC in channels, etc.), here's a guide I found:
https://matt.traudt.xyz/posts/2019-01-19-creating-private-v3-onion-services/I also archived it twice, since I saw this guy already moved his blog once in the past.
https://archive.fo/80CN4https://web.archive.org/web/20220130032823/https://matt.traudt.xyz/posts/2019-01-19-creating-private-v3-onion-services/Instead of doing this, I would simply turn off RTL via service when not needed (C-Lightning will obviously continue running) as shown.
Turning it back on for completeness: