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
*[Running lnd using the btcd backend](#running-lnd-using-the-btcd-backend)
19
+
*[Using Neutrino](#using-neutrino)
20
+
*[Using bitcoind or litecoind](#using-bitcoind-or-litecoind)
21
+
*[Macaroons](#macaroons)
22
+
*[Network Reachability](#network-reachability)
23
+
*[Simnet vs. Testnet Development](#simnet-vs.-testnet-development)
24
+
*[Creating an lnd.conf (Optional)](#creating-an-lnd.conf-(optional))
25
+
26
+
# Installation
27
+
7
28
### Preliminaries
8
29
In order to work with [`lnd`](https://github.com/lightningnetwork/lnd), the
9
30
following build dependencies are required:
@@ -119,10 +140,61 @@ To check that `lnd` was installed properly run the following command:
119
140
make check
120
141
```
121
142
122
-
On FreeBSD, use gmake instead of make.
143
+
# Available Backend Operating Modes
144
+
145
+
In order to run, `lnd` requires, that the user specify a chain backend. At the
146
+
time of writing of this document, there are three available chain backends:
147
+
`btcd`, `neutrino`, `bitcoind`. All but neutrino (atm) can run on mainnet with
148
+
an out of the box `lnd` instance. We don't require `--txindex` when running
149
+
with `bitcoind` or `btcd` but activating the `txindex` will generally make
150
+
`lnd` run faster.
151
+
152
+
**NOTE: WE DO NOT FULLY SUPPORT PRUNED OPERATING MODES FOR FULL NODES.** It's
153
+
possible to run a node in a pruned mode and have it serve lnd, however one must
154
+
take care to ensure that `lnd` has all blocks on disk since the birth of the
155
+
wallet, and the age of the earliest channels (which were created around March
156
+
2018).
157
+
158
+
The set of arguments for each of the backend modes is as follows:
159
+
160
+
## btcd Options
161
+
```
162
+
btcd:
163
+
--btcd.dir= The base directory that contains the node's data, logs, configuration file, etc. (default: /Users/roasbeef/Library/Application Support/Btcd)
164
+
--btcd.rpchost= The daemon's rpc listening address. If a port is omitted, then the default port for the selected chain parameters will be used. (default: localhost)
165
+
--btcd.rpcuser= Username for RPC connections
166
+
--btcd.rpcpass= Password for RPC connections
167
+
--btcd.rpccert= File containing the daemon's certificate file (default: /Users/roasbeef/Library/Application Support/Btcd/rpc.cert)
168
+
--btcd.rawrpccert= The raw bytes of the daemon's PEM-encoded certificate chain which will be used to authenticate the RPC connection.
169
+
```
170
+
171
+
## Neutrino Options
172
+
```
173
+
neutrino:
174
+
-a, --neutrino.addpeer= Add a peer to connect with at startup
175
+
--neutrino.connect= Connect only to the specified peers at startup
176
+
--neutrino.maxpeers= Max number of inbound and outbound peers
177
+
--neutrino.banduration= How long to ban misbehaving peers. Valid time units are {s, m, h}. Minimum 1 second
178
+
--neutrino.banthreshold= Maximum allowed ban score before disconnecting and banning misbehaving peers.
179
+
```
180
+
181
+
## Bitcoind Options
182
+
```
183
+
bitcoind:
184
+
--bitcoind.dir= The base directory that contains the node's data, logs, configuration file, etc. (default: /Users/roasbeef/Library/Application Support/Bitcoin)
185
+
--bitcoind.rpchost= The daemon's rpc listening address. If a port is omitted, then the default port for the selected chain parameters will be used. (default: localhost)
186
+
--bitcoind.rpcuser= Username for RPC connections
187
+
--bitcoind.rpcpass= Password for RPC connections
188
+
--bitcoind.zmqpubrawblock= The address listening for ZMQ connections to deliver raw block notifications
189
+
--bitcoind.zmqpubrawtx= The address listening for ZMQ connections to deliver raw transaction notifications
190
+
```
191
+
192
+
## Using btcd
123
193
124
194
### Installing btcd
125
195
196
+
On FreeBSD, use gmake instead of make.
197
+
126
198
To install btcd, run the following commands:
127
199
128
200
Install **btcd**:
@@ -174,30 +246,17 @@ You can test your `btcd` node's connectivity using the `getpeerinfo` command:
174
246
btcctl --testnet --rpcuser=REPLACEME --rpcpass=REPLACEME getpeerinfo | more
175
247
```
176
248
177
-
### lnd
178
-
179
-
#### Simnet vs. Testnet Development
249
+
### Running lnd using the btcd backend
180
250
181
-
If you are doing local development, such as for the tutorial, you'll want to
182
-
start both `btcd` and `lnd` in the `simnet` mode. Simnet is similar to regtest
183
-
in that you'll be able to instantly mine blocks as needed to test `lnd`
184
-
locally. In order to start either daemon in the `simnet` mode use `simnet`
185
-
instead of `testnet`, adding the `--bitcoin.simnet` flag instead of the
186
-
`--bitcoin.testnet` flag.
187
-
188
-
Another relevant command line flag for local testing of new `lnd` developments
189
-
is the `--debughtlc` flag. When starting `lnd` with this flag, it'll be able to
190
-
automatically settle a special type of HTLC sent to it. This means that you
191
-
won't need to manually insert invoices in order to test payment connectivity.
192
-
To send this "special" HTLC type, include the `--debugsend` command at the end
193
-
of your `sendpayment` commands.
194
-
195
-
196
-
There are currently two primary ways to run `lnd`: one requires a local `btcd`
197
-
instance with the RPC service exposed, and the other uses a fully integrated
198
-
light client powered by [neutrino](https://github.com/lightninglabs/neutrino).
251
+
If you are on testnet, run this command after `btcd` has finished syncing.
252
+
Otherwise, replace `--bitcoin.testnet` with `--bitcoin.simnet`. If you are
253
+
installing `lnd` in preparation for the
254
+
[tutorial](http://dev.lightning.community/tutorial), you may skip this step.
0 commit comments