No description
Find a file
Oliver Gugger 85ed9d1bf3
make: drop darwin-386 build target
Since we also dropped support for building binaries for the darwin 386
architecture in loop, we remove that build target in LiT as well.
2020-10-12 15:32:04 +02:00
.github/workflows ci: add yarn cache to backend CI build 2020-07-29 08:43:07 -04:00
.vscode chore: update npm dependencies (#68) 2020-06-30 01:49:43 -04:00
app loop: add additional options to swap wizard 2020-09-07 13:55:06 -04:00
cmd/litd terminal+config: implement remote lnd mode 2020-10-12 15:32:04 +02:00
doc doc+README: document config options 2020-10-12 15:32:04 +02:00
make make: drop darwin-386 build target 2020-10-12 15:32:04 +02:00
proto mod: update LND to v0.11.0 and Loop to v0.8.0 2020-08-24 12:06:25 -04:00
statik multi: replace standalone gRPC web proxy with unified binary 2020-06-02 14:29:38 +02:00
.dockerignore cmd: rename binary to litd 2020-07-21 22:10:33 +02:00
.gitignore doc: add walkthrough document 2020-07-28 23:10:16 -04:00
.prettierrc docs: reformat readme markdown 2020-06-13 00:39:59 -04:00
config.go terminal+config: implement remote lnd mode 2020-10-12 15:32:04 +02:00
Dockerfile docker: add protoc to docker image 2020-07-29 16:49:35 -04:00
go.mod terminal+config: implement remote lnd mode 2020-10-12 15:32:04 +02:00
go.sum multi: update lnd, loop and faraday 2020-10-08 09:34:39 +02:00
gzip.go multi: rename golang and make files to lightning-terminal 2020-07-21 22:06:15 +02:00
log.go terminal: extract RPC proxy 2020-10-12 15:28:04 +02:00
Makefile cmd: rename binary to litd 2020-07-21 22:10:33 +02:00
README.md doc+README: document config options 2020-10-12 15:32:04 +02:00
release.sh cmd: rename binary to litd 2020-07-21 22:10:33 +02:00
rpc_proxy.go terminal: extract RPC proxy 2020-10-12 15:28:04 +02:00
subserver_permissions.go terminal: extract RPC proxy 2020-10-12 15:28:04 +02:00
terminal.go terminal+config: implement remote lnd mode 2020-10-12 15:32:04 +02:00

Lightning Terminal (LiT)

CI

screenshot

Lightning Terminal (LiT) is a browser-based interface for managing the off-chain liquidity of your lnd Lightning Network node. It presents a visual representation of your channels and balances, while allowing you to perform submarine swaps via the Lightning Loop service using a graphical interface. With a bird's eye view of all of your open channels, you can instantly see which ones need your immediate attention.

You can configure the UI to classify channels according to your node's operating mode.

  • Optimize for Receiving: For merchants who primarily receive inbound Lightning payments, the channels with high local balances will be shaded red.
  • Optimize for Routing: For routing node operators, that want to keep their channels balanced close to 50%, the channels with a high balance in either direction will be flagged.
  • Optimize for Sending: For exchanges, fiat gateways, and other operators who primarily send outgoing Lightning payments, the channels with low local balances will be shaded red.

Architecture

LiT is packaged as a single binary which contains the lnd, loopd and faraday daemons all in one. It also contains an HTTP server to serve the web assets (html/js/css) and a GRPC proxy to forward web requests from the browser to the appropriate GRPC server. This deployment strategy was chosen as it greatly simplifies the operational overhead of installation, configuration and maintenance that would be necessary to run each of these servers independently. You only need to download one executable and run one command to get LiT up and running. We include the CLI binaries lncli, loop and frcli for convenience in the downloadable archives as well.

Daemon Versions packaged with LiT

LiT LND Loop Faraday
v0.2.0-alpha v0.11.1-beta v0.9.0-beta v0.2.1-alpha
v0.1.1-alpha v0.11.0-beta v0.8.1-beta v0.2.0-alpha
v0.1.0-alpha v0.10.3-beta v0.6.5-beta v0.2.0-alpha

Usage

Read the Walkthrough document to learn more about how to use Lightning Terminal.

Installation

There are two options for installing LiT: download the published binaries for your platform, or compile from source code.

Download Binaries

LiT binaries for many platforms are made available on the GitHub Releases page in this repo. There you can download the latest version and extract the archive into a directory on your computer.

Compile from Source Code

To compile from source code, you'll need to have some prerequisite developer tooling installed on your machine.

Dependency Description
golang LiT's backend web server is written in Go. The minimum version supported is Go v1.13.
protoc Required to compile LND & Loop gRPC proto files at build time
nodejs LiT's frontend is written in TypeScript and built on top of the React JS web framework. To bundle the assets into Javascript & CSS compatible with web browsers, NodeJS is required.
yarn a popular package manager for NodeJS application dependencies

Once you have the necessary prerequisites, LiT can be compiled by running the following commands:

$ git clone https://github.com/lightninglabs/lightning-terminal.git
$ cd lightning-terminal
$ make install

This will produce the litd executable and add it to your GOPATH. The CLI binaries for lncli, loop, and frcli are not created by make install. You will need to download those binaries from the lnd, loop, and faraday repos manually.

Executing CLI Commands

When executing loop and frcli commands, you will need to specify the connection info since the daemons are now integrated into lnd's GRPC server.

Examples:

$ loop --rpcserver=localhost:10009 --tlscertpath=$HOME/.lnd/tls.cert --macaroonpath=$HOME/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
$ frcli --rpcserver=localhost:10009 --tlscertpath=$HOME/.lnd/tls.cert --macaroonpath=$HOME/.lnd/data/chain/bitcoin/mainnet/admin.macaroon

Configuration

LiT only has a few configuration parameters itself.

Required

You must set httpslisten to the host & port that the https server should listen on. Also set uipassword to a strong password to use to login to the website in your browser. A minimum of 8 characters is required. In a production environment, it's recommended that you store this password as an environment variable.

Optional

You can also configure the HTTP server to automatically install a free SSL certificate provided by LetsEncrypt. This is recommended if you plan to access the website from a remote computer and do not want to deal with the browser warning you about the self-signed certificate. You just need to specify the domain name you wish to use, and make sure port 80 is open in your firewall. LetsEncrypt requires this to verify that you own the domain name. LiT will listen on port 80 to handle the verification requests.

On some linux-based platforms, you may need to run LiT with superuser privileges since port 80 is a system port. You can permit the CAP_NET_BIND_SERVICE capability using setcap 'CAP_NET_BIND_SERVICE=+eip' /path/to/litd to allow binding on port 80 without needing to run the daemon as root.

Note: LiT only serves content over HTTPS. If you do not use letsencrypt, LiT will use the self-signed certificate that is auto-generated by lnd to encrypt the browser-to-server communication. Web browsers will display a warning when using the self-signed certificate.

Application Options:
      --httpslisten=      host:port to listen for incoming HTTP/2 connections on (default: 127.0.0.1:8443)
      --uipassword=       the password that must be entered when using the loop UI. use a strong
                          password to protect your node from unauthorized access through the web UI
      --letsencrypt       use Let's Encrypt to create a TLS certificate for the UI instead of using
                          lnd's TLS certificate. port 80 must be free to listen on and must be reachable
                          from the internet for this to work
      --letsencrypthost=  the host name to create a Let's Encrypt certificate for'
      --letsencryptdir=   the directory where the Let's Encrypt library will store its key and
                          certificate (default: /Users/<username>/Library/Application Support/Lnd/letsencrypt)

Lnd mode

Starting with LiT v0.2.0-alpha, you now have the choice of either running an lnd node in the same process as the UI (which is called the "integrated" lnd mode) or connect the UI to an already running lnd node (called "remote" mode).

Because that single decision has an impact on the configuration options that need to be used, the documentation has been split into two parts, each explaining one mode in detail.

Troubleshooting

If you have trouble running your node, please first check the logs for warnings or errors. If there are errors relating to one of the embedded servers, then you should open an issue in their respective GitHub repos (lnd, loop, faraday. If the issue is related to the web app, then you should open an issue here in this repo.

Server

Server-side logs are stored in the directory specified by lnd.lnddir in your configuration. Inside, there is a logs dir containing the log files in subdirectories. Be sure to set lnd.debuglevel=debug in your configuration to see the most verbose logging information.

Browser

Client-side logs are disabled by default in production builds. Logging can be turned on by adding a couple keys to your browser's localStorage. Simply run these two JS statements in you browser's DevTools console then refresh the page:

localStorage.setItem('debug', '*'); localStorage.setItem('debug-level', 'debug');

The value for debug is a namespace filter which determines which portions of the app to display logs for. The namespaces currently used by the app are as follows:

  • main: logs general application messages
  • action: logs all actions that modify the internal application state
  • grpc: logs all GRPC API requests and responses

Example filters: main,action will only log main and action messages. *,-action will log everything except action messages.

The value for debug-level determines the verbosity of the logs. The value can be one of debug, info, warn, or error.