You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shushtar 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](https://lightning.engineering/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.
8
8
9
-
Install client app dependencies
9
+
You can configure the UI to classify channels according to your node's operating mode.
10
+
11
+
-**Optimize for Receiving**: For merchants who primarily receive inbound Lightning payments, the channels with high local balances will be shaded red.
12
+
-**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.
13
+
-**Optimize for Sending**: For exchanges, fiat gateways, and other operators who primarily send outgoing Lightning payments, the channels with high local balances will be shaded red.
14
+
15
+
## Architecture
16
+
17
+
Shushtar is packaged as a single binary which contains the [`lnd`](https://github.com/lightningnetwork/lnd), [`loopd`](https://github.com/lightninglabs/loop) and [`faraday`](https://github.com/lightninglabs/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 Shushtar up and running. We include the CLI binaries `lncli`, `loop` and `frcli` for convenience in the downloadable archives as well.
18
+
19
+
## Installation
20
+
21
+
There are two options for installing Shushtar: download the published binaries for your platform, or compile from source code.
22
+
23
+
#### Download Binaries
24
+
25
+
Shushtar binaries for many platforms are made available on the GitHub [Releases](https://github.com/lightninglabs/shushtar/releases) page in this repo. There you can download the latest version and extract the archive into a directory on your computer.
26
+
27
+
#### Compile from Source Code
28
+
29
+
To compile from source code, you'll need to have some prerequisite developer tooling installed on your machine.
30
+
31
+
-**Go**: Shushtar's backend web server is written in Go. Instructions for installing Go for your operating system can be found on the [golang install](https://golang.org/doc/install) page. The minimum version supported is Go v1.13.
32
+
-**NodeJS**: Shushtar'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. It can be downloaded and installed by following the instructions on the [NodeJS download](https://nodejs.org/en/download/) page.
33
+
34
+
Once you have the necessary prerequisites, Shushtar can be compiled by running the following commands:
This will produce the `shushtar` executable and add it to your `GOPATH`.
43
+
44
+
## Configuration
45
+
46
+
Shushtar only has a few configuration parameters itself.
47
+
48
+
#### Required
49
+
50
+
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.
51
+
52
+
#### Optional
53
+
54
+
You can also configure the HTTP server to automatically install a free SSL certificate provided by [LetsEncrypt](https://letsencrypt.org/). 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 in your firewall. LetsEncrypt requires this to verify that you own the domain name. Shushtar will listen on port 80 to handle the verification requests. On some linux-based platforms, you may need to run Shushtar with superuser privileges since port 80 is a system port.
55
+
56
+
> Note: Shushtar only serves content over **HTTPS**. If you do not use `letsencrypt`, Shushtar 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.
57
+
58
+
```
59
+
Application Options:
60
+
--httpslisten= host:port to listen for incoming HTTP/2 connections on (default: 127.0.0.1:8443)
61
+
--uipassword= the password that must be entered when using the loop UI. use a strong
62
+
password to protect your node from unauthorized access through the web UI
63
+
--letsencrypt use Let's Encrypt to create a TLS certificate for the UI instead of using
64
+
lnd's TLS certificate. port 80 must be free to listen on and must be reachable
65
+
from the internet for this to work
66
+
--letsencrypthost= the host name to create a Let's Encrypt certificate for'
67
+
--letsencryptdir= the directory where the Let's Encrypt library will store its key and
In addition to the Shushtar specific parameters, you must also provide configuration to the `lnd`, `loop` and `faraday` daemons. For `lnd`, each flag must be prefixed with `lnd.` (ex: `lnd.lnddir=~/.lnd`). Please see the [sample-lnd.conf](https://github.com/lightningnetwork/lnd/blob/master/sample-lnd.conf) file for more details on the available parameters. Note that `loopd` and `faraday` will automatically connect to the in-process `lnd` node, so you do not need to provide them with any additional parameters unless you want to override them. If you do override them, be sure to add the `loop.` and `faraday.` prefixes.
72
+
73
+
Here is an example command to start `shushtar` on testnet with a local `bitcoind` node:
74
+
75
+
```
76
+
$ ./shushtar \
77
+
--httpslisten=0.0.0.0:443 \
78
+
--uipassword=My$trongP@ssword \
79
+
--letsencrypt \
80
+
--letsencrypthost=loop.merchant.com \
81
+
--lnd.lnddir=/root/.lnd \
82
+
--lnd.alias=merchant \
83
+
--lnd.externalip=loop.merchant.com \
84
+
--lnd.rpclisten=0.0.0.0:10009 \
85
+
--lnd.listen=0.0.0.0:9735 \
86
+
--lnd.bitcoin.active \
87
+
--lnd.bitcoin.testnet \
88
+
--lnd.bitcoin.node=bitcoind \
89
+
--lnd.bitcoind.rpchost=localhost \
90
+
--lnd.bitcoind.rpcuser=testnetuser \
91
+
--lnd.bitcoind.rpcpass=testnetpw \
92
+
--lnd.bitcoind.zmqpubrawblock=localhost:28332 \
93
+
--lnd.bitcoind.zmqpubrawtx=localhost:28333 \
94
+
--lnd.debuglevel=debug \
95
+
--loop.loopoutmaxparts=5 \
96
+
--faraday.min_monitored=48h
97
+
```
98
+
99
+
You can also store the configuration in a persistent `lnd.conf` file so you do not need to type in the command line arguments every time you start the server. Just remember to use the appropriate prefixes as necessary.
100
+
101
+
Example `lnd.conf`:
102
+
103
+
```
104
+
[Application Options]
105
+
httpslisten=0.0.0.0:443
106
+
letsencrypt=1
107
+
letsencrypthost=loop.merchant.com
108
+
109
+
[Lnd]
110
+
lnd.lnddir=~/.lnd
111
+
lnd.alias=merchant
112
+
lnd.externalip=loop.merchant.com
113
+
lnd.rpclisten=0.0.0.0:10009
114
+
lnd.listen=0.0.0.0:9735
115
+
lnd.debuglevel=debug
116
+
117
+
[Bitcoin]
118
+
lnd.bitcoin.active
119
+
lnd.bitcoin.testnet
120
+
lnd.bitcoin.node=bitcoind
121
+
122
+
[Bitcoind]
123
+
lnd.bitcoind.rpchost=localhost
124
+
lnd.bitcoind.rpcuser=testnetuser
125
+
lnd.bitcoind.rpcpass=testnetpw
126
+
lnd.bitcoind.zmqpubrawblock=localhost:28332
127
+
lnd.bitcoind.zmqpubrawtx=localhost:28333
128
+
129
+
[Loop]
130
+
loop.loopoutmaxparts=5
131
+
132
+
[Faraday]
133
+
faraday.min_monitored=48h
10
134
11
-
```sh
12
-
npm install -g yarn # if yarn isn't already installed
13
-
cd app/
14
-
yarn
15
135
```
16
136
17
-
## Development
137
+
The default location for the `lnd.conf` file will depend on your operating system:
18
138
19
-
- Compile and start the GrUB (see [Run the GrUB](#run-the-grub))
If you already have existing `lnd`, `loop`, or `faraday` nodes, you can easily upgrade them to the Shushtar single executable while keeping all of your past data.
146
+
147
+
For `lnd`:
148
+
149
+
- if you use an `lnd.conf` file for configurations, add the `lnd.` prefix to each of the configuration parameters.
150
+
151
+
Before:
152
+
```
153
+
[Application Options]
154
+
alias=merchant
155
+
```
156
+
After:
157
+
```
158
+
[Application Options]
159
+
lnd.alias=merchant
160
+
```
161
+
- if you use command line arguments for configuration, add the `lnd.` prefix to each argument to `shushtar`
- if you use an `loop.conf` file for configurations, copy the parameters into the `lnd.conf` file that `shushtar` uses, and add the `loop.` prefix to each of the configuration parameters.
175
+
176
+
Before: (in `loop.conf`)
177
+
178
+
```
179
+
[Application Options]
180
+
loopoutmaxparts=5
24
181
```
25
182
26
-
Open browser at http://localhost:3000
183
+
After: (in `lnd.conf`)
27
184
28
-
## Testing
185
+
```
186
+
[Loop]
187
+
loop.loopoutmaxparts=5
188
+
```
29
189
30
-
- Run all unit tests and output coverage
31
-
```sh
32
-
yarn test:ci
190
+
- if you use command line arguments for configuration, add the `loop.` prefix to each argument to `shushtar`
191
+
192
+
Before:
193
+
```
194
+
$ loop --loopoutmaxparts=5 --debuglevel=debug ...
33
195
```
34
-
- Run tests on locally modified files in watch mode
Storybook allows you to view the app's UI components using sample data. It is helpful when building components as you do not need to spin up a full development environment. It also allows you to get quick previews of how the components will be displayed in multiple different states, based on the props and data provided to them.
203
+
-the standalone `faraday` daemon does not load configuration from a file, but you can now store the parameters into the `lnd.conf` file that `shushtar` uses. Just add the `faraday.` prefix to each of the configuration parameters.
42
204
43
-
- Launch Storybook explorer
44
-
```sh
45
-
yarn
46
-
yarn storybook
205
+
Before: (from command line)
206
+
```
207
+
$ faraday --min_monitored=48h
208
+
```
209
+
After: (in `lnd.conf`)
210
+
```
211
+
[Faraday]
212
+
faraday.min_monitored=48h
47
213
```
48
214
49
-
## Logging
215
+
- if you use command line arguments for configuration, add the `faraday.` prefix to each argument to `shushtar`
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](https://github.com/lightningnetwork/lnd/issues), [loop](https://github.com/lightninglabs/loop/issues), [faraday](https://github.com/lightninglabs/faraday/issues). If the issue is related to the web app, then you should open an [issue](https://github.com/lightninglabs/shushtar/issues) here in this repo.
50
229
51
-
Client-side logs are disabled by default in production builds and enabled by default in a development environment. In production, 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:
230
+
#### Server
231
+
232
+
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.
233
+
234
+
#### Browser
235
+
236
+
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:
0 commit comments