Ride-The-Lightning-RTL/README.md

163 lines
6 KiB
Markdown
Raw Normal View History

2019-02-18 09:25:33 -05:00
## Ride The Lightning (RTL)
![](screenshots/RTL_Home.png)
2019-01-27 19:31:32 -05:00
<a href="https://snyk.io/test/github/ShahanaFarooqui/RTL"><img src="https://snyk.io/test/github/ShahanaFarooqui/RTL/badge.svg" alt="Known Vulnerabilities" data-canonical-src="https://snyk.io/test/github/ShahanaFarooqui/RTL" style="max-width:100%;"></a>
2019-02-21 19:07:38 -05:00
[![license](https://img.shields.io/github/license/DAVFoundation/captain-n3m0.svg?style=flat-square)](https://github.com/DAVFoundation/captain-n3m0/blob/master/LICENSE)
2019-02-20 19:34:45 -05:00
### Stable Release: v0.2.1
2019-02-20 19:34:30 -05:00
2019-02-17 16:51:43 -05:00
**Intro** -- [Application Features](Application_features.md) -- [Road Map](Roadmap.md) -- [LND API Coverage](LNDAPICoverage.md) -- [Application Configurations](Application_configurations)
2018-11-17 12:17:12 -05:00
2019-02-16 20:20:38 -05:00
* [Introduction](#intro)
2019-02-18 14:06:51 -05:00
* [Architecture](#arch)
2019-02-16 20:29:56 -05:00
* [Prerequisites](#prereq)
* [Installation](#install)
* [Prep For Execution](#prep)
* [Start The Server](#start)
* [Access The Application](#access)
* [Troubleshooting](#trouble)
### <a name="intro"></a>Introduction
2019-02-18 10:42:43 -05:00
RTL is a full function, device agnostic web user interface for Lightning Network Daemon, to help manage lightning node operations.
2019-02-18 09:51:58 -05:00
Lightning Network Daemon is an implementation of Lightning Network BOLT protocol by [Lightning Labs](https://lightning.engineering/).
2018-09-14 21:32:18 -04:00
2019-02-18 09:51:58 -05:00
Pre-requisite for running RTL is a functioning LND node. You can setup your own node, by following the below guides:
* Windows/Mac users can explore Pierre Rochard's [Node Launcher](https://github.com/lightning-power-users/node-launcher)
* Linux or Raspberry Pi users can explore Stadicus's [guide](https://github.com/Stadicus/guides/blob/master/raspibolt/README.md)
2018-09-14 21:32:18 -04:00
2019-02-18 09:51:58 -05:00
RTL source code is available at this [repo](https://github.com/ShahanaFarooqui/RTLFullApplication)
2018-09-14 21:32:18 -04:00
2019-02-18 09:51:58 -05:00
For detailed screenshots and UI operation guide you can visit our [medium post](https://medium.com/@suheb.khan/how-to-ride-the-lightning-447af999dcd2)
2018-12-31 18:05:55 -05:00
2019-02-18 14:06:51 -05:00
### <a name="arch"></a>Architecture
2019-02-18 14:13:24 -05:00
![](screenshots/RTL_Arch.png)
2019-02-18 14:06:51 -05:00
2019-02-16 20:29:56 -05:00
### <a name="prereq"></a>Prerequisites
2018-10-07 18:04:25 -04:00
Please ensure that you have completed the installation of LND lightning node.
2018-09-14 21:32:18 -04:00
2019-02-18 09:59:44 -05:00
The application also requires Node.js, which can be downloaded [here](https://nodejs.org/en/download/)
2018-11-01 20:33:53 -04:00
Recommended Browsers: Chrome, Firefox, MS Edge
2018-09-15 23:27:11 -04:00
2019-02-16 20:29:56 -05:00
### <a name="install"></a>Installation
2018-11-18 09:03:14 -05:00
#### First time setup
2018-10-07 18:04:25 -04:00
Fetch sources from the RTL git repository, by executing the below command at the command prompt:
2018-09-14 21:32:18 -04:00
2018-10-07 18:13:14 -04:00
`$ git clone https://github.com/ShahanaFarooqui/RTL.git`
2018-09-14 21:32:18 -04:00
2018-10-07 18:04:25 -04:00
Move to the newly created directory:
2018-09-14 21:32:18 -04:00
2018-10-07 18:13:14 -04:00
`$ cd RTL`
2018-09-14 21:32:18 -04:00
Fetch the dependencies and build the application by running:
2018-10-07 18:13:14 -04:00
`$ npm install`
2018-09-14 21:32:18 -04:00
2018-11-18 09:03:14 -05:00
#### Updating existing build
2019-02-17 16:58:37 -05:00
```
2019-02-17 17:05:40 -05:00
$ cd RTL
2019-02-17 16:58:37 -05:00
$ git reset --hard HEAD
$ git clean -f -d
$ git pull
$ npm install
```
2019-02-16 20:29:56 -05:00
### <a name="prep"></a>Prep for Execution
2019-02-20 20:55:12 -05:00
Rename `sample-RTL.conf` file to `RTL.conf`.
RTL requires its config file `RTL.conf`, to start the server and provide user authentication on the app.
2019-01-01 11:26:51 -05:00
Locate the complete path of the readable macroon file (admin.macroon) on your node and lnd.conf file
The path of the macroon directory and lnd.conf needs to be provided in the RTL.conf file to start the server.
2018-09-14 21:37:04 -04:00
2019-02-20 20:55:12 -05:00
For details on all the configuration options refer to [this page](https://github.com/ShahanaFarooqui/RTL/blob/master/Application_configurations).
2019-01-01 11:26:51 -05:00
Sample RTL.conf:
```
[Authentication]
2019-02-20 20:55:12 -05:00
macaroonPath=C:\Users\<user>\AppData\Local\Lnd\data\chain\bitcoin\testnet
nodeAuthType=CUSTOM
lndConfigPath=C:\Users\<user>\AppData\Local\Lnd\lnd.conf
rtlPass=***
[SSO]
rtlSSO=0
rtlCookiePath=C:\RTL\cookies\auth.cookie
logoutRedirectLink=/login
2019-01-01 11:26:51 -05:00
[Settings]
flgSidenavOpened=true
flgSidenavPinned=true
menu=Vertical
menuType=Regular
theme=dark-blue
satsToBTC=false
2019-02-20 20:55:12 -05:00
lndServerUrl=https://192.168.0.0:8080/v1
bitcoindConfigPath=
enableLogging=false
port=3000
2019-01-01 11:26:51 -05:00
```
#### User Authentication on RTL
2019-02-20 20:55:12 -05:00
Basic user authentication has now been added on RTL. This requires user to be authenticated by RTL first, before accessing LND functions.
2019-01-01 11:26:51 -05:00
There are two options to configure authentication on RTL, depending on the `nodeAuthtype` value provided in RTL.conf.
2018-10-07 18:21:45 -04:00
2019-01-01 11:26:51 -05:00
For `nodeAuthType=DEFAULT`
Password provided in lnd.conf for the rpc setting for bitcoind will be used for authentication.
2018-10-07 18:21:45 -04:00
2019-01-01 11:26:51 -05:00
For `nodeAuthType=CUSTOM`
2019-02-20 20:55:12 -05:00
Specific password can be provided in RTL.conf (in plain text), to be used by RTL for authentication.
2019-01-01 11:26:51 -05:00
Password should be set with `rtlPass=<user defined>` in the [Authentication] section of RTL.conf
2018-10-07 18:21:45 -04:00
2019-02-16 20:29:56 -05:00
### <a name="start"></a>Start the Server
2019-01-01 11:26:51 -05:00
Run the following command:
2018-10-07 18:21:45 -04:00
2019-01-01 11:26:51 -05:00
`node rtl`
2018-09-14 21:32:18 -04:00
If the server started successfully, you should get the below output on the console:
`Server is up and running, please open the UI at http://localhost:3000`
2018-11-17 12:18:35 -05:00
#### Optional: Running RTL as a service (rpi or Linux platform users)
2018-10-07 18:20:31 -04:00
In case you are running a headless rpi or Linux node, you can configure RTL as a service.
2018-10-07 18:29:02 -04:00
* Create RTL systemd unit and with the following content. Save and exit.
2018-10-09 19:22:28 -04:00
```bash
# Raspibolt RTL: systemd unit for RTL
# /etc/systemd/system/RTL.service
2018-10-07 18:29:02 -04:00
[Unit]
Description=RTL daemon
Wants=lnd.service
2018-10-07 18:31:41 -04:00
After=lnd.service
2018-10-07 18:29:50 -04:00
2018-10-07 18:29:02 -04:00
[Service]
2019-01-01 11:26:51 -05:00
ExecStart=/usr/bin/node /home/admin/Projects/RTL/rtl
2018-10-09 19:23:35 -04:00
User=<user>
2018-10-07 18:29:02 -04:00
Restart=always
TimeoutSec=120
RestartSec=30
[Install]
WantedBy=multi-user.target
2018-10-09 19:22:28 -04:00
```
2018-10-07 18:39:30 -04:00
2018-10-07 18:35:48 -04:00
* enable and start RTL
2019-02-17 16:58:37 -05:00
```
$ sudo systemctl enable RTL
$ sudo systemctl start RTL
```
2018-10-07 18:35:48 -04:00
* montior the RTL log file in realtime(exit with Ctrl-C)
2018-10-07 18:36:37 -04:00
2019-01-10 10:27:13 -05:00
`$ sudo journalctl -f -u RTL`
2018-10-07 18:35:48 -04:00
2019-02-16 20:29:56 -05:00
### <a name="access"></a>Accessing the Application
2018-09-27 21:25:15 -04:00
You can access the application in two ways:
2019-02-17 17:04:17 -05:00
#### Same device as the server
2018-09-15 23:21:12 -04:00
Open your browser at the following address: http://localhost:3000 to access the RTL application.
2018-09-27 21:25:15 -04:00
2019-02-17 17:04:17 -05:00
#### Remotely from another device on the same local network as the node
Ensure that the firewall running on your node allows access on port 3000 (or the custom port configured for RTL).
Determine the IP address of your node to access the application.
2018-09-27 21:39:09 -04:00
E.g. if the IP address of your node is 192.168.0.15 then open your browser at the following address: http://192.168.0.15:3000 to access RTL.
2018-12-31 18:05:55 -05:00
2019-02-16 20:29:56 -05:00
### <a name="trouble"></a>Troubleshooting
2019-02-23 18:11:44 -05:00
In case you are running into issues with the application or if you have feedback, feel free to open issues on our github repo.
You can also reach out to us via twitter DM on @Sauby_k or @RTL_App. Thanks for your interest.