Commit Graph

202 Commits

Author SHA1 Message Date
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
Wilmer Paulino
44bc563396
config+cmd/lncli: add flag to specify the base dir for lnd
In this commit, we introduce a new flag `--lnddir` that allows us to
set a different base directory, other than the OS specific application
data directory, for all related lnd files and directories.
2018-03-12 22:23:56 -04:00
Conner Fromknecht
b8254803be
config: add unsafe-disconnect and unsafe-replay for testing 2018-03-09 21:18:14 -08:00
Olaoluwa Osuntokun
abcf822bf9
config: add new option to the tor config for stream isolation 2018-02-09 12:16:13 -08:00
Juan Ignacio Donoso
bb42cb55ba config: adds an extra tls ip to config
This commit adds the `tlsextraip` flag to the cli to add an
ip to the generated certificate. This is usefull when using
a loadbalancer to access the node.
2018-02-08 15:23:52 -08:00
MeshCollider
61eedfbeb7 config: Clarify the default behaviour of externalip 2018-02-08 15:21:04 -08:00
practicalswift
a93736d21e multi: comprehensive typo fixes across all packages 2018-02-06 19:11:11 -08:00
MeshCollider
69f207e23f torsvc: Replace MultiNet with polymorphic Net interface 2018-02-05 17:37:46 -08:00
MeshCollider
4affab7bd7 multi: Addressing Tor support review comments 2018-02-05 17:37:46 -08:00
nsa
698df2ac16 torsvc: added new type that multiplexes torsvc and net packages
This commit adds the `lnnet` package which contains an
implementation of the newly created LightningNet interface which
multiplexes the Dial and DNS-related functions to use net
by default and torsvc if a flag is specified. This modularization
makes for cleaner code.
2018-02-05 17:37:46 -08:00
nsa
8c482f2be7 multi: Added a NetInterface to clean up config.go
This commit adds a new interface named NetInterface and two
implementations of it: RegularNet & TorProxyNet. These two structs
are used in config.go in an attempt to clean up the code and
abstract away the dialer and DNS functions.
2018-02-05 17:37:46 -08:00
nsa
e132ad8433 torsvc: Added new module to house Tor functions
This commit adds a new module named 'torsvc' which houses all Tor
functionality in an attempt to isolate it and make it reusable in
other projecs. Some additional tweaks were made to config.go and
to the bootstrapper.
2018-02-05 17:37:46 -08:00
nsa
e2142c778f multi: Added Tor support
This commit adds Tor support. Users can set the --TorSocks flag
to specify which port Tor's SOCKS5 proxy is listening on so that
lnd can connect to it. When this flag is set, ALL traffic gets
routed over Tor including DNS traffic. Special functions for
DNS lookups were added, and since Tor doesn't natively support
SRV requests, the proxySRV function routes connects us to
a DNS server via Tor and SRV requests can be issued directly
to the DNS server.

Co-authored-by: MeshCollider <dobsonsa68@gmail.com>
2018-02-05 17:37:46 -08:00
Conner Fromknecht
6286a93cf5 config: separate chain directory 2018-01-31 17:37:08 -08:00
Olaoluwa Osuntokun
e953c6abcf
config: add stricter config parsing to avoid dangerous RPC auth combos
In this commit, we add an additional constraint to the RPC
configuration parsing. Before this commit, it was possible to start lnd
with either RPC server listening on an external interface *without*
authentication disabled. After this commit, if a user tries to start
the RPC server listening on an external interface without any sort of
RPC authentication, then the daemon will fail to start up.
2018-01-28 15:03:29 -08:00
Alex
4559438c4b config.go: check for RPCUser AND RPCPass (AND ZMQPath for bitcoind)
This commit causes the configuration parser to accept the values of
RPCUser, RPCPass, and (for the bitcoind back-end) ZMQPath configured
in lnd.conf or on the command line ONLY when all are specified. It
causes the configuration parser to look in btcd.conf or bitcoin.conf
ONLY when none are specified, and causes an error to be returned when
only some are specified, as users have done so erroneously and the
lack of clear feedback has caused difficulties.
2018-01-24 21:53:31 -08:00
Olaoluwa Osuntokun
4f91b66c51
Merge pull request #467 from bcongdon/feature/customize-alias-and-color
cmd/lncli+lnd: Add alias and color customization
2018-01-24 16:48:36 -08:00
Olaoluwa Osuntokun
f8adab1f1c
test: add comprehensive integration tests for on-chain HTLC handling
In this commit, we add 6 new integration tests to test the various
actions that may need to be performed when either side goes on-chain to
fully resolve HTLC’s. Many of the tests are mirrors of each other as
they test sweeping/resolving HTLC’s from both commitment transactions.
2018-01-22 19:20:02 -08:00