From 0f1927992ec21d73500c81109463fd11cbe98163 Mon Sep 17 00:00:00 2001 From: Matheus Degiovani Date: Tue, 23 Apr 2019 16:43:40 -0300 Subject: [PATCH] docs: Update install and sample conf to decred This updates the install document and the sample-dcrlnd.conf file to refer to the decred-specific port. --- docs/INSTALL.md | 29 +++------ sample-lnd.conf | 170 +++++++++--------------------------------------- 2 files changed, 41 insertions(+), 158 deletions(-) diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 857185636e..490b2d0cea 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -24,16 +24,16 @@ **Note**: The minimum version of Go supported is Go 1.11. We recommend that users use the latest version of Go, which at the time of writing is - [`1.11`](https://blog.golang.org/go1.11). + [`1.12`](https://blog.golang.org/go1.12). On Linux: ``` - sudo apt-get install golang-1.11-go + sudo apt-get install golang-1.12-go ``` - > Note that golang-1.11-go puts binaries in /usr/lib/go-1.11/bin. If you want them on your PATH, you need to make that change yourself. Alternatively, you can run: + > Note that golang-1.12-go puts binaries in /usr/lib/go-1.12/bin. If you want them on your PATH, you need to make that change yourself. Alternatively, you can run: ``` - sudo ln -s /usr/lib/go-1.11/bin/go /usr/local/bin/go + sudo ln -s /usr/lib/go-1.12/bin/go /usr/local/bin/go ``` On Mac OS X: @@ -67,7 +67,7 @@ * **go modules:** This project uses [go modules](https://github.com/golang/go/wiki/Modules) to manage dependencies as well as to provide *reproducible builds*. - Usage of go modules (with go 1.11) means that you no longer need to clone + Usage of go modules (with go 1.12) means that you no longer need to clone `dcrlnd` into your `$GOPATH` for development purposes. Instead, your `dcrlnd` repo can now live anywhere! @@ -134,14 +134,8 @@ make check In order to run, `dcrlnd` requires, that the user specify a chain backend. At the time of writing of this document, only the `dcrd` backend can be used. We -don't require `--txindex` when running with `dcrd` but activating the `txindex` -will generally make `dcrlnd` run faster. +currently *require* `--txindex` when running with `dcrd`. -**NOTE: WE DO NOT FULLY SUPPORT PRUNED OPERATING MODES FOR FULL NODES.** It's -possible to run a node in a pruned mode and have it serve lnd, however one must -take care to ensure that `dcrlnd` has all blocks on disk since the birth of the -wallet, and the age of the earliest channels (which were created around March -2018). The set of arguments for each of the backend modes is as follows: @@ -162,7 +156,7 @@ dcrd: On FreeBSD, use gmake instead of make. -To install btcd, run the following commands: +To install dcrd, run the following commands: Install **dcrd**: ``` @@ -177,13 +171,10 @@ repo](https://github.com/decred/dcrd). Running the following command will create `rpc.cert` and default `dcrd.conf`. ``` -dcrd --testnet --rpcuser=REPLACEME --rpcpass=REPLACEME +dcrd --testnet --rpcuser=REPLACEME --rpcpass=REPLACEME --txindex ``` If you want to use `dcrlnd` on testnet, `dcrd` needs to first fully sync the testnet blockchain. Depending on your hardware, this may take up to a few hours. -Note that adding `--txindex` is optional, as it will take longer to sync the -node, but then `dcrlnd` will generally operate faster as it can hit the index -directly, rather than scanning blocks or BIP 158 filters for relevant items. While `dcrd` is syncing you can check on its progress using dcrd's `getinfo` RPC command: @@ -211,7 +202,7 @@ You can test your `dcrd` node's connectivity using the `getpeerinfo` command: dcrctl --testnet --rpcuser=REPLACEME --rpcpass=REPLACEME getpeerinfo | more ``` -### Running lnd using the dcrd backend +### Running dcrlnd using the dcrd backend If you are on testnet, run this command after `dcrd` has finished syncing. Otherwise, replace `--decred.testnet` with `--decred.simnet`. If you are @@ -226,7 +217,7 @@ dcrlnd --decred.active --decred.testnet --debuglevel=debug --dcrd.rpcuser=kek -- `dcrlnd`'s authentication system is called **macaroons**, which are decentralized bearer credentials allowing for delegation, attenuation, and other cool features. You can learn more about them in Alex Akselrod's [writeup on -Github](https://github.com/decred/dcrlnd/issues/20). + the original lnd issue](https://github.com/lightningnetwork/lnd/issues/20). Running `dcrlnd` for the first time will by default generate the `admin.macaroon`, `read_only.macaroon`, and `macaroons.db` files that are used diff --git a/sample-lnd.conf b/sample-lnd.conf index d49fc1cde3..2fce0a5ac2 100644 --- a/sample-lnd.conf +++ b/sample-lnd.conf @@ -1,16 +1,16 @@ [Application Options] -; The directory that lnd stores all wallet, chain, and channel related data -; within The default is ~/.lnd/data on POSIX OSes, $LOCALAPPDATA/Lnd/data on -; Windows, ~/Library/Application Support/Lnd/data on Mac OS, and $home/lnd/data +; The directory that dcrlnd stores all wallet, chain, and channel related data +; within The default is ~/.dcrlnd/data on POSIX OSes, $LOCALAPPDATA/Dcrlnd/data on +; Windows, ~/Library/Application Support/Dcrlnd/data on Mac OS, and $home/dcrlnd/data ; on Plan9. Environment variables are expanded so they may be used. NOTE: ; Windows environment variables are typically %VARIABLE%, but they must be ; accessed with $VARIABLE here. Also, ~ is expanded to $LOCALAPPDATA on Windows. -; datadir=~/.lnd/data +; datadir=~/.dcrlnd/data ; The directory that logs are stored in. The logs are auto-rotated by default. ; Rotated logs are compressed in place. -; logdir=~/.lnd/logs +; logdir=~/.dcrlnd/logs ; Number of logfiles that the log rotation should keep. Setting it to 0 disables deletion of old log files. ; maxlogfiles=3 @@ -37,25 +37,25 @@ ; the line below. ; no-macaroons=true -; Path to write the admin macaroon for lnd's RPC and REST services if it +; Path to write the admin macaroon for dcrlnd's RPC and REST services if it ; doesn't exist. This can be set if one wishes to store the admin macaroon in a -; distinct location. By default, it is stored within lnd's network directory. +; distinct location. By default, it is stored within dcrlnd's network directory. ; Applications that are able to read this file, gain admin macaroon access. -; adminmacaroonpath=~/.lnd/data/chain/bitcoin/simnet/admin.macaroon +; adminmacaroonpath=~/.dcrlnd/data/chain/decred/simnet/admin.macaroon ; Path to write the read-only macaroon for lnd's RPC and REST services if it ; doesn't exist. This can be set if one wishes to store the read-only macaroon ; in a distinct location. The read only macaroon allows users which can read ; the file to access RPCs which don't modify the state of the daemon. By ; default, it is stored within lnd's network directory. -; readonlymacaroonpath=~/.lnd/data/chain/bitcoin/simnet/readonly.macaroon +; readonlymacaroonpath=~/.dcrlnd/data/chain/decred/simnet/readonly.macaroon ; Path to write the invoice macaroon for lnd's RPC and REST services if it ; doesn't exist. This can be set if one wishes to store the invoice macaroon in ; a distinct location. By default, it is stored within lnd's network directory. ; The invoice macaroon allows users which can read the file to gain read and ; write access to all invoice related RPCs. -; invoicemacaroonpath=~/.lnd/data/chain/bitcoin/simnet/invoice.macaroon +; invoicemacaroonpath=~/.dcrlnd/data/chain/decred/simnet/invoice.macaroon ; Specify the interfaces to listen on for p2p connections. One listen @@ -142,163 +142,55 @@ ; color=#3399FF -[Bitcoin] +[Decred] -; If the Bitcoin chain should be active. Atm, only a single chain can be +; If the Decred chain should be active. Atm, only a single chain can be ; active. -bitcoin.active=1 +decred.active=1 -; Use Bitcoin's test network. -; bitcoin.testnet=1 +; Use Decred's test network. +; decred.testnet=1 ; -; Use Bitcoin's simulation test network -bitcoin.simnet=1 +; Use Decred's simulation test network +decred.simnet=1 -; Use Bitcoin's regression test network -; bitcoin.regtest=false +; Use Decred's regression test network +; decred.regtest=false -; Use the btcd back-end -bitcoin.node=btcd - -; Use the bitcoind back-end -; bitcoin.node=bitcoind - -; Use the neutrino (light client) back-end -; bitcoin.node=neutrino +; Use the dcrd back-end +decred.node=dcrd ; The default number of confirmations a channel must have before it's considered ; open. We'll require any incoming channel requests to wait this many ; confirmations before we consider the channel active. -; bitcoin.defaultchanconfs=3 +; decred.defaultchanconfs=3 -[Btcd] +[Dcrd] -; The host that your local btcd daemon is listening on. By default, this +; The host that your local dcrd daemon is listening on. By default, this ; setting is assumed to be localhost with the default port for the current ; network. -; btcd.rpchost=localhost +; dcrd.rpchost=localhost -; Username for RPC connections to btcd. By default, lnd will attempt to +; Username for RPC connections to dcrd. By default, lnd will attempt to ; automatically obtain the credentials, so this likely won't need to be set ; (other than for simnet mode). -; btcd.rpcuser=kek +; dcrd.rpcuser=kek -; Password for RPC connections to btcd. By default, lnd will attempt to +; Password for RPC connections to dcrd. By default, lnd will attempt to ; automatically obtain the credentials, so this likely won't need to be set ; (other than for simnet mode). -; btcd.rpcpass=kek +; dcrd.rpcpass=kek ; File containing the daemon's certificate file. This only needs to be set if ; the node isn't on the same host as lnd. -; btcd.rpccert=~/.btcd/rpc.cert +; dcrd.rpccert=~/.dcrd/rpc.cert ; The raw bytes of the daemon's PEM-encoded certificate chain which will be used ; to authenticate the RPC connection. This only needs to be set if the btcd ; node is on a remote host. -; btcd.rawrpccert= - - -[Bitcoind] - -; The host that your local bitcoind daemon is listening on. By default, this -; setting is assumed to be localhost with the default port for the current -; network. -; bitcoind.rpchost=localhost - -; Username for RPC connections to bitcoind. By default, lnd will attempt to -; automatically obtain the credentials, so this likely won't need to be set -; (other than for a remote bitcoind instance). -; bitcoind.rpcuser=kek - -; Password for RPC connections to bitcoind. By default, lnd will attempt to -; automatically obtain the credentials, so this likely won't need to be set -; (other than for a remote bitcoind instance). -; bitcoind.rpcpass=kek - -; ZMQ socket which sends rawblock and rawtx notifications from bitcoind. By -; default, lnd will attempt to automatically obtain this information, so this -; likely won't need to be set (other than for a remote bitcoind instance). -; bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332 -; bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333 - - -[neutrino] - -; Connect only to the specified peers at startup. This creates a persistent -; connection to a target peer. This is recommended as there aren't many -; neutrino compliant full nodes on the test network yet. -; neutrino.connect= - -; Add a peer to connect with at startup. -; neutrino.addpeer= - - -[Litecoin] - -; If the Litecoin chain should be active. Atm, only a single chain can be -; active. -; litecoin.active=1 - -; Use Litecoin's test network. -; litecoin.testnet=1 - -; Use the ltcd back-end -litecoin.node=ltcd - -; Use the litecoind back-end -; litecoin.node=litecoind - - -[Ltcd] - -; The host that your local ltcd daemon is listening on. By default, this -; setting is assumed to be localhost with the default port for the current -; network. -; ltcd.rpchost=localhost - -; Username for RPC connections to ltcd. By default, lnd will attempt to -; automatically obtain the credentials, so this likely won't need to be set -; (other than for simnet mode). -; ltcd.rpcuser=kek - -; Password for RPC connections to ltcd. By default, lnd will attempt to -; automatically obtain the credentials, so this likely won't need to be set -; (other than for simnet mode). -; ltcd.rpcpass=kek - -; File containing the daemon's certificate file. This only needs to be set if -; the node isn't on the same host as lnd. -; ltcd.rpccert=~/.ltcd/rpc.cert - -; The raw bytes of the daemon's PEM-encoded certificate chain which will be used -; to authenticate the RPC connection. This only needs to be set if the ltcd -; node is on a remote host. -; ltcd.rawrpccert= - - -[Litecoind] - -; The host that your local litecoind daemon is listening on. By default, this -; setting is assumed to be localhost with the default port for the current -; network. -; litecoind.rpchost=localhost - -; Username for RPC connections to litecoind. By default, lnd will attempt to -; automatically obtain the credentials, so this likely won't need to be set -; (other than for a remote litecoind instance). -; litecoind.rpcuser=kek - -; Password for RPC connections to litecoind. By default, lnd will attempt to -; automatically obtain the credentials, so this likely won't need to be set -; (other than for a remote litecoind instance). -; litecoind.rpcpass=kek - -; ZMQ socket which sends rawblock and rawtx notifications from litecoind. By -; default, lnd will attempt to automatically obtain this information, so this -; likely won't need to be set (other than for a remote litecoind instance). -; litecoind.zmqpubrawblock=tcp://127.0.0.1:28332 -; litecoind.zmqpubrawtx=tcp://127.0.0.1:28333 +; dcrd.rawrpccert= [autopilot]