Commit Graph

219 Commits

Author SHA1 Message Date
Valentine Wallace
25b540fec4 chainregistry+config: add neutrino flag to assert filter header chain 2019-06-06 16:05:12 -07:00
Joost Jager
054e42f680
routing+routerrpc: expose mission control parameters in lnd config
This commit exposes the three main parameters that influence mission
control and path finding to the user as command line or config file
flags. It allows for fine-tuning for optimal results.
2019-06-04 13:22:50 +02:00
Joost Jager
dff0387363
lntest: move itest into package 2019-05-28 21:43:23 +02:00
Johan T. Halseth
4806003b74
Merge pull request #2704 from MDrollette/multiple-opts
config: allow adding multiple tls ips and domains
2019-05-22 08:59:19 +02:00
Karl Ranna
d941220762 config: fix litecoin simnet mode
This commit fixes a bug where it was impossible to run lnd in litecoin's
simnet mode because of code duplication. As a result `numNets > 1`
conditional was always true when running lnd with `cfg.Litecoin.SimNet`
flag.
2019-05-05 18:35:20 +03:00
Joost Jager
5d2de91241
config: update broadcast delta to reduce risk of channel force close 2019-05-03 12:22:30 +02:00
Danny Paz
6fd5ef88b6 add litecoin regtest configuration to lnd
regtest change to chainregistry for default port number

merge w/ master
2019-04-26 21:14:26 -07:00
Johan T. Halseth
b53899c43c
lnd: rename package main->lnd 2019-04-23 20:57:33 +02:00
Olaoluwa Osuntokun
6c4566bfce
Merge pull request #2949 from wpaulino/lncfg-parse-network
lncfg: parse network for TCP addresses to listen on correct interface
2019-04-22 16:01:28 -07:00
Conner Fromknecht
ab4a6750cc
Merge pull request #1865 from ExchangeUnion/litecoin-simnet
config: Experimental support for Litecoin/simnet
2019-04-19 14:43:47 -07:00
Olaoluwa Osuntokun
1fa13e5cfc chainregistry+config: enable neutrino fee estimation from external api
Co-authored-by: Valentine Wallace <vwallace@protonmail.com>
2019-04-16 14:16:56 -07:00
Wilmer Paulino
88aafe5c91
config: enforce safe auth of gRPC/REST listeners after parsing 2019-04-12 18:39:14 -07:00
Wilmer Paulino
be727ab0be config+server: expose HistoricalSyncInterval flag
This allows us to set how often the daemon should routinely perform
historical graph syncs.
2019-04-11 15:45:19 -07:00
Conner Fromknecht
25d2b1b537
Merge pull request #2885 from cfromknecht/stagger-initial-reconnect
server: stagger initial reconnects
2019-04-05 15:46:12 -07:00
Joost Jager
ab4da0f53d
cnct: define separate broadcast delta for outgoing htlcs
This commits exposes the various parameters around going to chain and
accepting htlcs in a clear way.

In addition to this, it reverts those parameters to what they were
before the merge of commit d1076271456bdab1625ea6b52b93ca3e1bd9aed9.
2019-04-05 11:36:07 +02:00
Conner Fromknecht
cf80476e01
server: stagger initial reconnects
This commit adds optional jitter to our initial reconnection to our
persistent peers. Currently we will attempt reconnections to all peers
simultaneously, which results in large amount of contention as the
number of channels a node has grows.

We resolve this by adding a randomized delay between 0 and 30 seconds
for all persistent peers. This spreads out the load and contention to
resources such as the database, read/write pools, and memory
allocations. On my node, this allows to start up with about 80% of the
memory burst compared to the all-at-once approach.

This also has a second-order effect in better distributing messages sent
at constant intervals, such as pings. This reduces the concurrent jobs
submitted to the read and write pools at any given time, resulting in
better reuse of read/write buffers and fewer bursty allocation and
garbage collection cycles.
2019-04-05 02:31:58 -07:00
Wilmer Paulino
80b84eef9c
config+peer: replace NoChanUpdates flag with NumGraphSyncPeers
In this commit, we replace the NoChanUpdates flag with a flag that
allows us to specify the number of peers we want to actively receive new
graph updates from. This will be required when integrating the new
gossiper SyncManager subsystem with the rest of lnd.
2019-04-03 15:43:51 -07:00
Conner Fromknecht
433665932c
config: expose Caches subconfig 2019-04-01 16:34:17 -07:00
Olaoluwa Osuntokun
9512d7036f
config: add new backupfilepath argument for SCBs
In this commit, we add a new config option: `backupfilepath` for the new
SCB implementation. This argument allows users to specify a custom
location for the SCB file such as NFS or distinct partition.
2019-03-28 17:53:32 -07:00
Olaoluwa Osuntokun
71161848aa
Merge pull request #2736 from cfromknecht/config-num-workers
lncfg: add CLI worker configuration
2019-03-19 15:47:38 -07:00
Olaoluwa Osuntokun
b4a1024ac7
Merge pull request #2490 from aakselrod/tor-null-auth-and-listen-fixes
Tor null auth and listen fixes
2019-03-15 14:53:12 -07:00
Conner Fromknecht
d81ce61033
config: add sanity check to prevent non-negative worker counts 2019-03-13 20:32:52 -07:00
Conner Fromknecht
76116f0d1a
config: use CLI worker configuration instead of NumCPU() 2019-03-13 20:32:39 -07:00
Matt Drollette
261558aad6 config: allow adding multiple tls ips and domains 2019-03-10 13:53:37 -05:00
Conner Fromknecht
4686db4196
config+server+lnd_test: expose chan status manager config options
Exposes the three parameters that dictate
the behavior of the channel status manager:
 * --chan-enable-timeout
 * --chan-disable-timeout
 * --chan-status-sample-interval
2019-02-14 17:13:11 -08:00
Olaoluwa Osuntokun
b56e95587f
config: increase default trickle delay from 30s to 1m30s
In this commit, we increase the default trickle delay from 30s to 1m30s.
We do this as before we implement the new INV gossip mechanism, we want
to de-emphasise the quick propagation of updates through the network
which eats up bandwidth.
2019-01-25 14:40:28 -08:00
Johan T. Halseth
36e7694e8e
config+pilot: define autopilot.heuristic
And validate the config set by the user.
2019-01-23 09:05:42 +01:00
Alex Akselrod
66a150297a config: default to listening for p2p on localhost when tor enabled
When Tor is enabled, this change allows manual hidden service
configuration by defaulting to listening for p2p connections on
the loopback address. It also allows overriding this manually
for situations where the Tor daemon is running on another machine,
such as when using Whonix or OnionPi-like systems.
2019-01-18 22:45:31 -07:00
Conner Fromknecht
aa75680dcf
config: add minbackoff to mirror maxbackoff 2019-01-04 14:05:28 -08:00
Igor Cota
02442ecbae Server: make maximum backoff configurable 2018-12-06 10:57:09 +01:00
Conner Fromknecht
668bd4db33
Merge pull request #2094 from cfromknecht/validate-color
config: validate node color after reading config
2018-11-29 16:18:44 -08:00
Olaoluwa Osuntokun
a8ac3cfe7d
lnd+rpc: fix linter errors 2018-11-28 20:57:10 -08:00
Olaoluwa Osuntokun
4002caec69
config+rpc: create new generalized dynamic sub rpc server config framework
In this commit, we add the glue infrastructure to make the sub RPC
server system work properly. Our high level goal is the following: using
only the lnrpc package (with no visibility into the sub RPC servers),
the RPC server is able to find, create, run, and manage the entire set
of present and future sub RPC servers. In order to achieve this, we use
the reflect package and build tags heavily to permit a loosely coupled
configuration parsing system for the sub RPC servers.

We start with a new `subRpcServerConfigs` struct which is _always_
present.  This struct has its own group, and will house a series of
sub-configs, one for each sub RPC server. Each sub-config is actually
gated behind a build flag, and can be used to allow users on the command
line or in the config to specify arguments related to the sub-server. If
the config isn't present, then we don't attempt to parse it at all, if
it is, then that means the RPC server has been registered, and we should
parse the contents of its config.

The `subRpcServerConfigs` struct has two main methods:
`PopulateDependancies` and `FetchConfig`. The `PopulateDependancies` is
used to dynamically locate and set the config fields for each new
sub-server. As the config may not actually have any fields (if the build
flag is off), we use the reflect pacakge to determine if things are
compiled in or not, then if so, we dynamically set each of the config
parameters. The `PopulateDependancies` method implements the
`lnrpc.SubServerConfigDispatcher` interface. Our goal is to allow sub
servers to look up their actual config in this main config struct. We
achieve this by using reflect to look up the target field _as if it were
a key in a map_. If the field is found, then we check if it has any
actual attributes (it won't if the build flag is off), if it is, then we
return it as we expect it to be populated already.
2018-11-28 20:57:05 -08:00
whythat
2c9a039845 config: add option to disable incoming push amounts in OpenChannel
This is useful for merchant-side prevention of accidental pushes
during channel opening.
2018-11-02 01:54:02 +02:00
Conner Fromknecht
b0318e2b74
config: validate node color after reading config 2018-10-24 22:10:18 -07:00
Conner Fromknecht
0903fe3183
main+lnd: display build.Version() for commit hash 2018-10-05 13:04:45 +09:00
Offer Markovich
28213b784f config: Experimental support for Litecoin/simnet
This PR adds the configuration needed to run LND with Litecoin on simnet. The change is minimal and has no impact for users that don't enable this mode. When using this configuration, the user is being warned that this mode is not officially supported.
2018-09-14 09:03:09 +03:00
Olaoluwa Osuntokun
e6925cc5be
config: fix linter error 2018-09-12 22:10:14 -07:00
Olaoluwa Osuntokun
e23f889639
config: return an error if unable to parse values in the config file 2018-09-12 21:35:32 -07:00
Olaoluwa Osuntokun
c5ece1e509
Merge pull request #1843 from cfromknecht/change-noencryptwallet
Start deprecating noencryptwallet
2018-09-12 21:07:23 -07:00
Wilmer Paulino
8599b30c78
config: modify private key path to be onion type agnostic 2018-09-11 19:37:11 -07:00
Olaoluwa Osuntokun
146e0efe71
Merge pull request #1802 from wpaulino/equal-zmq-conf-error
config: ensure ZMQ options are not equal and defer creating lnddir until all flag parsing is done
2018-09-05 17:33:40 -07:00
Conner Fromknecht
d85e58f435
config: rename noencryptwallet to noseedbackup
This commit renames the confusing noencryptwallet
flag to noseedbackup, since this highlights the more
crucial information of the flags behavior to the user.
The description has also been capitalized to urge
the user think twice about what they're doing.
2018-09-04 20:52:43 -07:00
Wilmer Paulino
fd61c3c9b0
config: defer creating the base lnd dir until all flag parsing is done
In this commit, we defer creating the base lnd directory until all flag
parsing is done. We do this as it's possible that the config file
specifies a lnddir, but it isn't actually used as the directory has
already been created.
2018-09-04 16:36:15 -07:00
Wilmer Paulino
58ab6c1912
config: ensure ZMQ options when read from the config file are not equal 2018-09-04 16:36:14 -07:00
Conner Fromknecht
af0265f8fa
config: add experimental assumechanvalid flag 2018-09-03 20:15:18 -07:00
Olaoluwa Osuntokun
b9db220e8c
config: properly show list of sub-systems for show debuglevel
Fixes #1772.
2018-08-23 19:48:30 -07:00
Olaoluwa Osuntokun
4d74fa32a9
config: update comment for network directory 2018-08-23 18:05:22 -07:00
Wilmer Paulino
e1726ecb2f config: remove default macaroon path
Co-Authored-By: Karl Ranna <karl@karlranna.com>
2018-08-23 18:05:00 -07:00
Wilmer Paulino
9981fd8fa7 config+lnd: create macaroons files under the network dir
Co-Authored-By: Karl Ranna <karl@karlranna.com>
2018-08-23 18:05:00 -07:00
Wilmer Paulino
6ddae25487 config+cmd/lncli: make cleanAndExpandPath return empty string on empty path
Co-Authored-By: Karl Ranna <karl@karlranna.com>
2018-08-23 18:05:00 -07:00
Olaoluwa Osuntokun
147596047f
Merge pull request #1687 from halseth/disable-inactive-channels
Send ChannelUpdate with Disabled bit if channel inactive for 20 minutes
2018-08-17 18:04:19 -07:00
Johan T. Halseth
9e44b38eee
config: define InactiveChanTimeout 2018-08-17 23:24:13 +02:00
Wilmer Paulino
7724d86801
config+pilot: add flag to specify min confs for autopilot agent 2018-08-16 20:19:31 -07:00
Wilmer Paulino
89325a13b7
autopilot+config: support opening private channels with autopilot agent 2018-08-10 20:45:59 -07:00
Olaoluwa Osuntokun
61f5b3e3f1
Merge pull request #1709 from Empact/noisedial
Move noiseDial from config.go to server.go
2018-08-09 21:43:37 -07:00
Ben Woosley
896128efd0
Move noiseDial from config.go to server.go
noiseDial is only called from server.go, has nothing to do with configuration,
and moving it removes config.go's reliance on btcec and brontide.
2018-08-09 15:13:05 -04:00
Wilmer Paulino
75192a15e3
config: parse different ZMQ hosts for block and tx notifications
Due to recent changes to the BitcoindClient interface, we now require
the backing bitcoind to use different hosts for its ZMQ raw block and
raw transaction notifications. This was needed as the notification queue
maintained by the bitcoind node would sometimes overflow with
transactions and cause block notifications to be dropped/missed.
In this commit, we expand extractBitcoindRPCParams to account for this.
2018-08-08 20:26:29 -07:00
Olaoluwa Osuntokun
6f60f139f4 multi: switch over import paths from roasbeef/* to btcsuite/* 2018-07-13 17:05:39 -07:00
Wilmer Paulino
833d037f66
config: use config file within lnddir unless overwritten 2018-07-06 12:44:36 -07:00
Olaoluwa Osuntokun
d83f4fbb85
Merge pull request #1498 from yaslama/fix-1488
Fix the ability to disable p2p listening
2018-07-03 22:40:02 -05:00
Olaoluwa Osuntokun
552a371f09
Merge pull request #1475 from cfromknecht/disable-mainnet-debug-htlc
config: disable debug-htlc mode on mainnet
2018-07-03 22:26:45 -05:00
Conner Fromknecht
7d116abedb
config: disable debug-htlc mode on mainnet 2018-07-03 17:08:53 -07:00
Yaacov Akiba Slama
c9c47b3a51 Fix the ability to disable p2p listening 2018-07-03 07:54:17 +03:00
Wilmer Paulino
f5c82983e2
config: only normalize and resolve tor DNS host if it has changed
In the event that the default Tor DNS host wouldn't resolve, it would
prevent `lnd` from starting due to the failed lookup. This should fail
silently as it's only crucial during bootstrapping. However, if the user
has explicitly modified this, we should let them know of the error
immediately.
2018-06-29 16:25:57 -07:00
Wilmer Paulino
bbeb8b2ddd
lncfg+config: use address string in IsLoopback 2018-06-27 19:03:30 -07:00
Olaoluwa Osuntokun
17399994e4
config+server: update usage of lncfg methods to pass in resolver
In this commit, we update all the lncfg methods used to properly pass in
a new resolver. This is required in order to ensure that we don't leak
our DNS queries if Tor mode is active.
2018-06-27 18:10:34 -07:00
Oliver Gugger
c1b1dd96ef
lncfg: move configuration helper methods to new package 2018-06-14 08:19:09 +02:00
Oliver Gugger
460fa25871
config+lnd+server: add unix socket support 2018-06-14 08:19:09 +02:00
Wilmer Paulino
8651b4a422
config: clarify documentation for NAT traversal flag 2018-06-12 18:36:24 -07:00
Wilmer Paulino
5732f5a1c4
config: normalize external IPs when parsing config 2018-06-12 18:32:49 -07:00
John Griffith
ba0db4ce91
Added some additional comments 2018-06-12 18:32:47 -07:00
John Griffith
1c3df21d18
Added NatPmp option 2018-06-12 18:32:46 -07:00
John Griffith
b59077109c
Added Upnp support behind a configuration option, moved the logic to the server code 2018-06-12 18:32:44 -07:00
Olaoluwa Osuntokun
f9c220cc7b
config: fix bug w/ tor onion services, only disable listen if no v2 or v3 2018-06-05 17:40:48 -07:00
Wilmer Paulino
978fc7ba08
config+lnd: update tor config to include onion services flags
In this commit, we update the set of Tor flags to use sane defaults when
not specified. We also include some new flags related to the recent
onion services changes. This allows users to easily get set up on Tor by
only specifying the tor.active flag. If needed, the defaults can still
be overridden.
2018-06-04 20:41:40 -07:00
Olaoluwa Osuntokun
41e1a7b056
config: add new command line option to disable chan update all together
In this commit, we add a new command line option to allow (ideally
routing nodes) to disable receiving up-to-date channel updates all
together. This may be desired as it'll allow routing nodes to save on
bandwidth as they don't need the channel updates to passively forward
HTLCs. In the scenario that they _do_ want to update their routing
policies, the first failed HTLC due to policy inconsistency will then
allow the routing node to propagate the new update to potential nodes
trying to route through it.
2018-05-31 16:30:58 -07:00
Wilmer Paulino
e363766394
multi: increase max funding and payment amount 60x under Litecoin 2018-05-25 00:11:20 -04:00
Conner Fromknecht
ab607a7ec6
config: hodl config 2018-05-02 00:18:51 -07:00
Olaoluwa Osuntokun
7f039980c1
lnd+cmd/lncli: allow users to disable logging sub-systems all together 2018-04-16 19:18:04 -07:00
vegardengen
5eed171187 config: make log rotation configurable 2018-04-06 15:11:42 -07:00
Olaoluwa Osuntokun
b422e4ec1e
lnwallet+funding+lnd: add new config option for min accepted channel size
In this commit we add a new command line option (and a sane default) to
allow users to specify the *smallest* inbound channel that they'll
accept. Having a higher-ish limit lets users limit their channels, and
also avoid a series of very low value "spam" channels.

The new option is --minchansize, and expressed in satoshis. If we
receive an inbound channel request for a value smaller than this, then
we'll immediately reject it.
2018-04-02 16:17:58 -07:00
Laurent Raufaste
5cb1a84356 lnd: support space characters surrounding = in bitcoind configuration files
lnd can't detect bitcoind configuration if the config file has spaces around the = character, e.g.:
```
zmqpubrawblock = tcp://127.0.0.1:28332
zmqpubrawtx = tcp://127.0.0.1:28332
rpcuser = rpcuser
```
I had to dig into the source code to understand what was wrong.

This patch solves this problem, bitcoind's config parsing source code can be seen at https://github.com/bitcoin/bitcoin/blob/master/src/util.cpp
2018-03-31 16:06:00 -07:00
Matt Drollette
87333ba829 config: bind naked ports to localhost
If only a port is given as a config value for a listener we'll
default to only binding that port to localhost.
2018-03-31 16:00:56 -07:00
Corné Plooy
c2e5ba3b43 config: determine the bitcoind chain directory from the chain params instead of the config file. This is more reliable in case the chain was selected with a bitcoind commandline option instead of a line in the config file. 2018-03-28 15:19:00 -07:00
François
9997014420 config: invoice macaroon path fix 2018-03-25 19:28:47 -07:00
Olaoluwa Osuntokun
18e6705d97
config: fix linter error (gofmt -s) 2018-03-23 19:26:43 -07:00
Olaoluwa Osuntokun
ead55783c7
Merge pull request #916 from PWKad/master
Fix error labels when missing LTC configuration
2018-03-23 18:45:47 -07:00
Brenden Matthews
8a51043462
config: Fix formatting, missing param check.
Fixed formatting for autopilot config params, as well as added check for
`MaxChannels` param which was presumably a mistaken copypaste from the
`MaxChannelSize' param.
2018-03-23 21:11:45 -04:00
Patrick Walters
484b12c0f3 config: return proper daemon name for config errors
Fix #915 by capturing the current daemonName and using that in
error messages.
2018-03-22 18:05:14 -05:00
Olaoluwa Osuntokun
7d14ed7a06
Merge pull request #904 from Roasbeef/invoice-macaroon
rpc+lnd: add new invoice-only macaroon
2018-03-21 15:27:31 -07:00
Olaoluwa Osuntokun
0155bcfd5c
Merge pull request #881 from Roasbeef/autopilot-target-chan-size
funding+pilot: increase min channel size, allow specifying chan size range for autopilot
2018-03-21 15:11:25 -07:00
Olaoluwa Osuntokun
4c0dcdafa5
config+lnd: introduce new invoice-only macaroon
In this commit, we wrap up the prior ones and introduce config
settings, as well as proper generation for a new invoice-only macaroon.
All prior invoice path rules are also properly enforced of this new
invoice.macaroon.
2018-03-21 15:08:54 -07:00
Jonathan Underwood
237ed4fc6e lnd+config: add TLSExtraDomain to config
Self explanatory.

Needed for NodeJS, as the grpc library only allows TLS connections to domains and not IP addresses.
2018-03-20 15:57:14 -07:00
Olaoluwa Osuntokun
76f7a66259
config+pilot: add new config params to specify min+max autopilot chan size
In this commit, we add two new configuration parameters to allow users
to specify the min and max size that the autopilot agent will create.
This is useful as now users can set the values to more or less the same
size, which will allow them to control the size of each created
channel.

Before this commit, if this wasn’t set, then the agent would try to
shove as much money into a channel up until the max chan size. This was
nice on testnet, but on main net, users will likely not want all their
funds to be in a single channel, and instead be distributed across many
channels. With things like AMP, have more channels becomes more
desirable.
2018-03-18 17:10:28 -07:00
Olaoluwa Osuntokun
71a5fac9c7
lnd+config: add flags for mainnet 2018-03-15 06:38:45 -07:00
Conner Fromknecht
5e21c38fdb
config: adds litecoind+ltcd backend node options 2018-03-14 16:24:58 -07:00
Wilmer Paulino
9bf1b5399b
config: ensure all paths are cleaned and expanded after parsing options
In this commit, we ensure all paths to directories and files related to
LND are cleand and expanded before attempting to use them.

For example, in POSIX systems:
  - ~/lnd.conf would be expanded to /home/user/lnd.conf
  - $HOME/lnd.conf would be expanded to /home/user/lnd.conf
2018-03-12 22:24:32 -04:00
Wilmer Paulino
862729809e
config+cmd/lncli: ensure tilde in path is expanded to home dir
Since we're now able to create a base LND directory that no longer lives
under the OS specific application data directory, we modify
cleanAndExpandPath to replace the `~` in a path to the current user's
home directory, rather than the user's application data directory.
2018-03-12 22:24:04 -04:00
Wilmer Paulino
36e06cdd35
config: add flag to specify the dir for the supported backend nodes
In this commit, we introduce a new flag to set a custom path for a
backend node's data directory.
2018-03-12 22:24:03 -04:00