2017-04-01 17:03:34 +03:00
|
|
|
# Installation for lnd and btcd
|
2017-01-06 03:35:09 +03:00
|
|
|
|
|
|
|
### If Glide isn't installed, install it:
|
2017-04-01 17:03:34 +03:00
|
|
|
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
|
|
|
$ go get -u github.com/Masterminds/glide
|
|
|
|
```
|
|
|
|
|
2017-03-28 02:20:31 +03:00
|
|
|
### Install lnd:
|
2017-04-01 17:03:34 +03:00
|
|
|
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
|
|
|
$ cd $GOPATH
|
|
|
|
$ git clone https://github.com/lightningnetwork/lnd $GOPATH/src/github.com/lightningnetwork/lnd
|
2017-01-15 04:53:23 +03:00
|
|
|
$ cd $GOPATH/src/github.com/lightningnetwork/lnd
|
2017-01-06 03:35:09 +03:00
|
|
|
$ glide install
|
|
|
|
$ go install . ./cmd/...
|
|
|
|
```
|
|
|
|
|
2017-03-28 02:20:31 +03:00
|
|
|
### Install btcutil: (must be from roasbeef fork, not from btcsuite)
|
2017-04-01 17:03:34 +03:00
|
|
|
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
|
|
|
$ go get -u github.com/roasbeef/btcutil
|
|
|
|
```
|
|
|
|
|
2017-03-28 02:20:31 +03:00
|
|
|
### Install btcd: (must be from roasbeef fork, not from btcsuite)
|
2017-04-01 17:03:34 +03:00
|
|
|
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
|
|
|
$ cd $GOPATH/src/github.com/roasbeef/btcd
|
|
|
|
$ glide install
|
|
|
|
$ go install . ./cmd/...
|
|
|
|
```
|
|
|
|
|
2017-03-28 02:20:31 +03:00
|
|
|
### Start btcd (will create rpc.cert and default btcd.conf):
|
2017-04-01 17:03:34 +03:00
|
|
|
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
2017-01-15 04:53:23 +03:00
|
|
|
$ btcd --testnet --txindex --rpcuser=kek --rpcpass=kek
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
|
|
|
|
2017-04-01 17:03:34 +03:00
|
|
|
Before you'll be able to use `lnd` on testnet, `btcd` needs to first fully sync
|
|
|
|
the blockchain. Depending on your hardware, this may take up to a few hours.
|
2017-01-06 03:35:09 +03:00
|
|
|
|
2017-04-01 17:03:34 +03:00
|
|
|
(NOTE: It may take several minutes to find segwit-enabled peers.)
|
2017-01-06 03:35:09 +03:00
|
|
|
|
2017-04-01 17:03:34 +03:00
|
|
|
While `btcd` is syncing you can check on it's progress using btcd's `getinfo`
|
|
|
|
RPC command:
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
2017-04-01 17:03:34 +03:00
|
|
|
$ btcctl --testnet getinfo
|
|
|
|
{
|
|
|
|
"version": 120000,
|
|
|
|
"protocolversion": 70002,
|
|
|
|
"blocks": 1114996,
|
|
|
|
"timeoffset": 0,
|
|
|
|
"connections": 7,
|
|
|
|
"proxy": "",
|
|
|
|
"difficulty": 422570.58270815,
|
|
|
|
"testnet": true,
|
|
|
|
"relayfee": 0.00001,
|
|
|
|
"errors": ""
|
|
|
|
}
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
|
|
|
|
2017-04-01 17:03:34 +03:00
|
|
|
Additionally, you can monitor btcd's logs to track its syncing progress in real
|
|
|
|
time.
|
2017-03-01 04:32:28 +03:00
|
|
|
|
2017-04-01 17:03:34 +03:00
|
|
|
You can test your `btcd` node's connectivity using the `getpeerinfo` command:
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
2017-04-01 17:03:34 +03:00
|
|
|
$ btcctl --testnet getpeerinfo | more
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
|
|
|
|
2017-04-01 17:03:34 +03:00
|
|
|
### Start lnd: (once btcd has synced testnet)
|
|
|
|
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
2017-05-03 06:46:29 +03:00
|
|
|
$ lnd --bitcoin.active --bitcoin.testnet --debuglevel=debug --externalip=X.X.X.X
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
|
|
|
|
2017-04-01 17:03:34 +03:00
|
|
|
If you'd like to signal to other nodes on the network that you'll accept
|
|
|
|
incoming channels (as peers need to connect inbound to initiate a channel
|
|
|
|
funding workflow), then the `--externalip` flag should be set to your publicly
|
|
|
|
reachable IP address.
|
|
|
|
|
|
|
|
#### Simnet Development
|
|
|
|
|
|
|
|
If doing local development, you'll want to start both `btcd` and `lnd` in the
|
|
|
|
`simnet` mode. Simnet is similar to regtest in that you'll be able to instantly
|
|
|
|
mine blocks as needed to test `lnd` locally. In order to start either daemon in
|
2017-05-03 06:46:29 +03:00
|
|
|
the `simnet` mode add the `--bitcoin.simnet` flag instead of the
|
|
|
|
`--bitcoin.testnet` flag.
|
2017-04-01 17:03:34 +03:00
|
|
|
|
|
|
|
Another relevant command line flag for local testing of new `lnd` developments
|
|
|
|
is the `--debughtlc` flag. When starting `lnd` with this flag, it'll be able to
|
|
|
|
automatically settle a special type of HTLC sent to it. This means that you
|
|
|
|
won't need to manually insert invoices in order to test payment connectivity.
|
|
|
|
To send this "special" HTLC type, include the `--debugsend` command at the end
|
|
|
|
of your `sendpayment` commands.
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
2017-05-03 06:46:29 +03:00
|
|
|
$ lnd --bitcoin.active --bitcoin.simnet --debughtlc
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
|
|
|
|
2017-04-01 17:03:34 +03:00
|
|
|
### Create an lnd.conf (Optional)
|
|
|
|
|
|
|
|
Optionally, if you'd like to have a persistent configuration between `lnd`
|
2017-05-03 06:46:29 +03:00
|
|
|
launches, allowing you to simply type `lnd --bitcoin.testnet --bitcoin.active`
|
|
|
|
at the command line. You can create an `lnd.conf`.
|
2017-04-01 17:03:34 +03:00
|
|
|
|
|
|
|
**On MacOS, located at:**
|
|
|
|
`/Users/[username]/Library/Application Support/Lnd/lnd.conf`
|
|
|
|
|
|
|
|
**On Linux, located at:**
|
|
|
|
`~/.lnd/lnd.conf`
|
|
|
|
|
|
|
|
Here's a sample `lnd.conf` to get you started:
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
2017-04-01 17:03:34 +03:00
|
|
|
[Application Options]
|
|
|
|
debuglevel=trace
|
|
|
|
debughtlc=true
|
|
|
|
maxpendingchannels=10
|
|
|
|
profile=5060
|
2017-05-06 05:14:49 +03:00
|
|
|
externalip=128.111.13.23
|
|
|
|
externalip=111.32.29.29
|
2017-05-03 06:46:29 +03:00
|
|
|
|
|
|
|
[Bitcoin]
|
|
|
|
bitcoin.active=1
|
|
|
|
bitcoin.rpchost=localhost:18334
|
2017-01-06 03:35:09 +03:00
|
|
|
```
|
|
|
|
|
2017-05-03 06:46:29 +03:00
|
|
|
Notice the `[Bitcoin]` section. This section houses the parameters for the
|
|
|
|
Bitcoin chain. Also `lnd` also supports Litecoin, one is able to also specified
|
|
|
|
(but not concurrently with Bitcoin!) the proper parameters, so `lnd` knows to
|
|
|
|
be active on Litecoin's testnet4.
|
|
|
|
|
2017-03-28 02:20:31 +03:00
|
|
|
#### Accurate as of:
|
2017-07-05 02:05:05 +03:00
|
|
|
roasbeef/btcd commit: f8c02aff4e7a807ba0c1349e2db03695d8e790e8
|
2017-01-06 03:35:09 +03:00
|
|
|
|
2017-07-05 02:05:05 +03:00
|
|
|
roasbeef/btcutil commit: a259eaf2ec1b54653cdd67848a41867f280797ee
|
2017-01-06 03:35:09 +03:00
|
|
|
|
|
|
|
lightningnetwork/lnd commit: d7b36c6
|