lnd.xprv/docs/INSTALL.md

101 lines
2.4 KiB
Markdown
Raw Normal View History

# Installation for Lnd and Btcd
2017-01-06 03:35:09 +03:00
### If Glide isn't installed, install it:
```
$ go get -u github.com/Masterminds/glide
```
### Install lnd:
2017-01-06 03:35:09 +03:00
```
$ cd $GOPATH
$ git clone https://github.com/lightningnetwork/lnd $GOPATH/src/github.com/lightningnetwork/lnd
$ cd $GOPATH/src/github.com/lightningnetwork/lnd
2017-01-06 03:35:09 +03:00
$ glide install
$ go install . ./cmd/...
```
### Create lnd.conf:
2017-01-06 03:35:09 +03:00
**On MacOS, located at:**
/Users/[username]/Library/Application Support/Lnd/lnd.conf
**On Linux, located at:**
~/.lnd/lnd.conf
**lnd.conf:**
(Note: Replace `kek` with the username and password you prefer.)
```
[Application Options]
rpcuser=kek
rpcpass=kek
btcdhost=127.0.0.1
debuglevel=debug
```
### Install btcutil: (must be from roasbeef fork, not from btcsuite)
2017-01-06 03:35:09 +03:00
```
$ go get -u github.com/roasbeef/btcutil
```
### Install btcd: (must be from roasbeef fork, not from btcsuite)
2017-01-06 03:35:09 +03:00
```
$ cd $GOPATH/src/github.com/roasbeef/btcd
$ glide install
$ go install . ./cmd/...
```
### Start btcd (will create rpc.cert and default btcd.conf):
2017-01-06 03:35:09 +03:00
```
$ btcd --testnet --txindex --rpcuser=kek --rpcpass=kek
2017-01-06 03:35:09 +03:00
```
(Note: It may take several minutes to find segwit-enabled peers.)
### Add a limited username and password to btcd.conf and restart
2017-01-06 03:35:09 +03:00
(Note: Replace `kek` with the username and password you prefer.)
**On Linux:**
```
$ sed -i 's#; rpclimituser=whatever_limited_username_you_want#rpclimituser=kek#' ~/.btcd/btcd.conf
$ sed -i 's#; rpclimitpass=#rpclimitpass=kek#' ~/.btcd/btcd.conf
```
**On MacOS:**
```
$ sed -i 's#; rpclimituser=whatever_limited_username_you_want#rpclimituser=kek#' /Users/[username]/Library/Application Support/Btcd/btcd.conf
$ sed -i 's#; rpclimitpass=#rpclimitpass=kek#' /Users/[username]/Library/Application Support/Btcd/btcd.conf
```
If you did not have a `btcd.conf` file yet, you can simply paste the following into it:
````
[Application Options]
rpclimituser=<the username you picked in lnd.conf>
rpclimitpass=<the password you picked in lnd.conf>
````
2017-01-06 03:35:09 +03:00
**Then, regardless of OS:**
```
$ btcctl --testnet stop
$ btcd --testnet
```
### Check to see that peers are connected:
2017-01-06 03:35:09 +03:00
```
$ btcctl --testnet getpeerinfo | more
```
### Start Lnd: (Once btcd has synced testnet)
2017-01-06 03:35:09 +03:00
```
$ lnd --testnet
```
### Start Lnd on Simnet: (Doesnt require testnet syncing.)
2017-01-06 03:35:09 +03:00
```
$ lnd --simnet --debughtlc
```
#### Accurate as of:
roasbeef/btcd commit: 54362e17a5b80643ef1e12edc08895a2e2a1202b
2017-01-06 03:35:09 +03:00
roasbeef/btcutil commit: d347e49
lightningnetwork/lnd commit: d7b36c6