Builder's Guide
Search…
MacOS - Integrated Mode

Assumptions

    1.
    You have a MacOS system.
    2.
    Your MacOS system has bitcoind installed, synced on mainnet, and running as a daemon.
    3.
    ​
      1.
      To install bitcoind on MacOS, follow the official bitcoin.org guide.
    4.
    Your bitcoin.conf file has ZMQ publishing turned on.
      1.
      Txindex is not required, but pruned mode is not supported.

Get LiT

Download the version of the latest Lightning Terminal release that matches your local configuration (darwin-amd64). Extract the compressed files, and install the binaries using the below instructions.
1
# Extract the compressed files, and install them in your GOPATH
2
# GOPATH by default should be /usr/local/go/bin
3
tar -xvf lightning-terminal-darwin-amd64-<YOUR_LOCAL_VERSION>.tar.gz --strip 1 -C $GOPATH/bin
4
​
5
# If GOPATH is not defined, add your current folder to your PATH for simplicity
6
tar -xvf lightning-terminal-darwin-amd64-<YOUR_LOCAL_VERSION>.tar.gz
7
cd lightning-terminal-darwin-amd64-<YOUR_LOCAL_VERSION>
8
PATH=$PATH:$PWD
Copied!
Ensure that your system has only the required ports open for outbound communication with the Lightning Network.
1
sudo ufw logging on
2
sudo ufw enable
3
# PRESS Y
4
sudo ufw status
5
sudo ufw allow OpenSSH
6
sudo ufw allow 9735
7
sudo ufw allow 10009
8
sudo ufw allow 443
Copied!
If you are not already running lnd on this server, continue to the next section. If you are looking to upgrade an existing lnd instance, skip ahead.​

Fresh lnd Install

Because we assume you are not already running lnd, we will be creating a fresh configuration file for lnd to start within the same process as litd, alongside the UI server, faraday, pool, and loop.
1
# Create the Lightning Terminal directory and configuration file
2
mkdir ~/Library/Application Support/Lit/
3
vi ~/Library/Application Support/Lit/lit.conf
Copied!
Storing the configuration in a persistent ~/Library/Application Support/Lit/lit.conf file means you do not need to type in the command line arguments every time you start the server. Make sure you don't add any section headers (the lines starting with [ and ending with ], for example [Application Options]) as these don't work with the additional levels of sub configurations.
Paste this example lit.conf file into your terminal, and fill in the placeholders with your specific information.
1
# Application Options
2
httpslisten=0.0.0.0:443
3
lnd-mode=integrated
4
​
5
# Let's Encrypt
6
# You can configure the HTTPS server to automatically install a free SSL certificate provided by Let's Encrypt.
7
# This is recommended if you plan to access the website from a remote computer, but does require extra setup.
8
#letsencrypt=true
9
#letsencrypthost=<YOUR_DOMAIN>
10
​
11
# Lnd
12
lnd.lnddir=~/Library/Application Support/Lnd
13
lnd.alias=<YOUR_ALIAS>
14
lnd.externalip=<YOUR_IP>
15
lnd.rpclisten=0.0.0.0:10009
16
lnd.listen=0.0.0.0:9735
17
lnd.debuglevel=debug
18
​
19
# Lnd - bitcoin
20
lnd.bitcoin.active=true
21
lnd.bitcoin.mainnet=true
22
lnd.bitcoin.node=bitcoind
23
​
24
# Lnd - bitcoind
25
lnd.bitcoind.rpchost=localhost
26
lnd.bitcoind.rpcuser=<YOUR_RPCUSER>
27
lnd.bitcoind.rpcpass=<YOUR_RPCPASSWORD>
28
lnd.bitcoind.zmqpubrawblock=localhost:28332
29
lnd.bitcoind.zmqpubrawtx=localhost:28333
30
​
31
# Loop
32
loop.loopoutmaxparts=5
33
​
34
# Pool
35
pool.newnodesonly=true
36
​
37
# Faraday
38
faraday.min_monitored=48h
39
​
40
# Faraday - bitcoin
41
faraday.connect_bitcoin=true
42
faraday.bitcoin.host=localhost
43
faraday.bitcoin.user=<YOUR_RPCUSER>
44
faraday.bitcoin.password=<YOUR_RPCPASSWORD>
Copied!
Once you've done that, it's time to get LiT!
1
litd --uipassword=<YOUR_UI_PASSWORD>
Copied!
The very last step is to create your new lnd wallet. Crucially, faraday, pool, and loop do not start nor connect to lnd until after an lnd wallet has been created and unlocked. Open a new Terminal window and type the command:
1
lncli create
Copied!
Once you have secured your passwords and your seed phrase, Lightning Terminal is easy to browse to either on https://localhost:8443 if using a local machine or to your public URL if using a remote machine.
In the next major section of this guide, we've included example commands for interacting with the command line. See you there!

Upgrade Existing lnd

If you already have existing lnd, loop, or faraday nodes, you can easily upgrade them to the LiT single executable while keeping all of your past data.
Assuming you use an lnd.conf file for configurations, copy that file to your LiT directory and rename it to lit.conf.
1
# Create the Lightning Terminal directory and configuration file
2
mkdir ~/Library/Application Support/Lit/
3
cp ~/Library/Application Support/Lnd/lnd.conf ~/Library/Application Support/Lit/lit.conf
Copied!
Then edit lit.conf and add the lnd. prefix to each of the configuration parameters. You also have to remove any section headers (the lines starting with [ and ending with ], for example [Application Options]) as these don't work with the additional levels of sub configurations. You can replace them with a comment (starting with the # character) to get the same grouping effect as before. Additionally, you'll need to add any configuration parameters for loop, pool , and faraday to your new lit.conf file as well, with prefixes added for each parameter, respectively.
When finished, your new lit.conf should look like this:
1
# Application Options
2
httpslisten=0.0.0.0:443
3
lnd-mode=integrated
4
​
5
# Let's Encrypt
6
# You can configure the HTTPS server to automatically install a free SSL certificate provided by Let's Encrypt.
7
# This is recommended if you plan to access the website from a remote computer, but does require extra setup.
8
#letsencrypt=true
9
#letsencrypthost=<YOUR_DOMAIN>
10
​
11
# Lnd
12
lnd.lnddir=~/Library/Application Support/Lnd
13
lnd.alias=<YOUR_ALIAS>
14
lnd.externalip=<YOUR_IP>
15
lnd.rpclisten=0.0.0.0:10009
16
lnd.listen=0.0.0.0:9735
17
lnd.debuglevel=debug
18
​
19
# Lnd - bitcoin
20
lnd.bitcoin.active=true
21
lnd.bitcoin.mainnet=true
22
lnd.bitcoin.node=bitcoind
23
​
24
# Lnd - bitcoind
25
lnd.bitcoind.rpchost=localhost
26
lnd.bitcoind.rpcuser=<YOUR_RPCUSER>
27
lnd.bitcoind.rpcpass=<YOUR_RPCPASSWORD>
28
lnd.bitcoind.zmqpubrawblock=localhost:28332
29
lnd.bitcoind.zmqpubrawtx=localhost:28333
30
​
31
# Loop
32
loop.loopoutmaxparts=5
33
​
34
# Pool
35
pool.newnodesonly=true
36
​
37
# Faraday
38
faraday.min_monitored=48h
39
​
40
# Faraday - bitcoin
41
faraday.connect_bitcoin=true
42
faraday.bitcoin.host=localhost
43
faraday.bitcoin.user=<YOUR_RPCUSER>
44
faraday.bitcoin.password=<YOUR_RPCPASSWORD>
Copied!
Once you've done that, it's time to get LiT!
1
litd --uipassword=<YOUR_UI_PASSWORD>
Copied!
Crucially, faraday, pool, and loop do not start nor connect to lnd until after an lnd wallet has been unlocked. Open a new Terminal window and type the command:
1
lncli unlock
Copied!
Once unlocked, Lightning Terminal is easy to browse to either on https://localhost:8443 if using a local machine or to your public URL if using a remote machine.

Example commands for interacting with the command line

Because not all functionality of lnd (or loop/faraday for that matter) is available through the web UI, it will still be necessary to interact with those daemons through the command line.
We are going through an example for each of the command line tools and will explain the reasons for the extra flags. The examples assume that LiT is started with the following configuration (only relevant parts shown here):
1
lnd-mode=integrated
2
​
3
lnd.lnddir=~/Library/Application Support/Lnd
4
lnd.rpclisten=0.0.0.0:10009
5
​
6
lnd.bitcoin.testnet=true
Copied!
Because all components listen on the same gRPC port and use the same TLS certificate, some command line calls now need some extra options that weren't necessary before.
NOTE: All mentioned command line tools have the following behavior in common: You either specify the --network flag and the --tlscertpath and --macaroonpath are implied by looking inside the default directories for that network. Or you specify the --tlscertpath and --macaroonpath flags explicitly, then you must not set the --network flag. Otherwise, you will get an error like: [lncli] could not load global options: unable to read macaroon path (check the network setting!): open /Users/<user>/Library/Application Support/Lnd/data/chain/bitcoin/testnet/admin.macaroon: no such file or directory

Example lncli command

The lncli commands in the "integrated" mode are the same as if lnd was running standalone. The --lnddir flag does not need to be specified as long as it is the default directory (~/.lnd on Linux).
1
$ lncli --network=testnet getinfo
Copied!

Example loop command

This is where things get a bit tricky. Because as mentioned above, loopd also runs on the same gRPC server as lnd. That's why we have to both specify the host:port as well as the TLS certificate of lnd. But loopd verifies its own macaroon, so we have to specify that one from the .loop directory.
1
$ loop --rpcserver=localhost:10009 --tlscertpath=~/Library/Application Support/Lnd/tls.cert \
2
--macaroonpath=~/Library/Application Support/Loop/testnet/loop.macaroon \
3
quote out 500000
Copied!
You can easily create an alias for this by adding the following line to your ~/.bashrc file:
1
alias lit-loop="loop --rpcserver=localhost:10009 --tlscertpath=~/Library/Application Support/Lnd/tls.cert --macaroonpath=~/Library/Application Support/Loop/testnet/loop.macaroon"
Copied!

Example pool command

Again, poold also runs on the same gRPC server as lnd and we have to specify the host:port and the TLS certificate of lnd but use the macaroon from the .pool directory.
1
$ pool --rpcserver=localhost:10009 --tlscertpath=~/Library/Application Support/Lnd/tls.cert \
2
--macaroonpath=~/Library/Application Support/Pool/testnet/pool.macaroon \
3
accounts list
Copied!
You can easily create an alias for this by adding the following line to your ~/.bashrc file:
1
alias lit-pool="pool --rpcserver=localhost:10009 --tlscertpath=~/Library/Application Support/Lnd/tls.cert --macaroonpath=~/Library/Application Support/Pool/testnet/pool.macaroon"
Copied!

Example frcli command

Faraday's command line tool follows the same pattern as loop. We also have to specify the server and TLS flags for lnd but use faraday's macaroon:
1
$ frcli --rpcserver=localhost:10009 --tlscertpath=~/Library/Application Support/Lnd/tls.cert \
2
--macaroonpath=~/Library/Application Support/Faraday/testnet/faraday.macaroon \
3
audit
Copied!
You can easily create an alias for this by adding the following line to your ~/.bashrc file:
1
alias lit-frcli="frcli --rpcserver=localhost:10009 --tlscertpath=~/Library/Application Support/Lnd/tl
Copied!
Last modified 9mo ago