Commit Graph

74 Commits

Author SHA1 Message Date
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
Matt Drollette 86133e559b config: add peer, rpc, and rest listener options
This commit removes the `peerport` and `rpcport` config options and
adds `listen`, `rpclisten`, and `restlisten` options to allow setting
one or multiple interfaces to listen on for incoming connections.

It also adds a `nolisten` option to allow disabling the listener for
incoming peer connections.
2018-01-21 17:35:03 -08:00
Benjamin Congdon a40ee8fe8a
config: Add settings for Alias and Color
This commit adds configuration variables for setting the Color and Alias
of the Node.
2018-01-18 07:39:37 -06:00
Alex 9a02884d0b main/lntest: factor out node config options, add options for bitcoind
This commit factors out the btcd and ltcd options into their own sections
similar to neutrino, and adds a bitcoind section as well. Now, you specify
node options similarly to:

--ltcd.rpchost=...
or
--btcd.rpcuser=...
or
--bitcoind.zmqpath=...

For Bitcoin, you specify an alternate back-end to btcd as follows:

--bitcoin.node=bitcoind
or
--bitcoin.node=neutrino

You can also specify the default option:
--bitcoin.node=btcd

For Litecoin, only `btcd` mode is valid, and corresponds to the `ltcd`
section. For example:

--litecoin.node=btcd
--ltcd.rpchost=...

The new code also attempts to read the correct options and auth info
from bitcoin.conf just as it does from btcd.conf/ltcd.conf.
2018-01-15 13:59:34 -08:00
Johan T. Halseth 0815bd4eb0
config: make DefaultNumChanConfs part of chainConfig
This commit moves the definition of DefaultNumChanConfs into
the chainConfig (such that it is set as e.g.
"--bitcoin.defaultchanconfs"), making it possible to set
individually for different chains.

It also adds the flag DefaultRemoteDelay to the chainConfig,
which can be used to set the CSV delay we will require the remote
to wait before retrieving its own funds in case of an
uncooperative close of the channel.

Both these are set 0 by default (if not specified by the user),
which in that case we will dynamically set the values, scaling
them according to the channel size.
2018-01-12 22:56:54 +01:00
Johan T. Halseth f4feb1e697
config: add forwarding policy rules to config
This commit moves the forwarding policy rules for Bitcoin
and Litecoin, previously defined in the chainregistry, to
config.go, making them possible to define by the user.
We validate that the TimeLockDelta set is at least 4, the
other rules we let the user specify arbitrarily, even 0.
2018-01-12 22:56:40 +01:00
Matt Drollette adf0d98194 multi: fix several typos in godoc comments 2017-12-17 18:40:05 -08:00
Olaoluwa Osuntokun c5049125f8
config+test: increase default num confs for funding flows to 3
In this commit, we increase the default number of confirmations we
require for funding flows from 1 to 3. The value of 1 was rather
unstable on testnet due to the frequent multi-block re-orgs.
Additionally, a value of 3 ensures our funding transaction is
sufficiently buried before we deem is usable.
2017-12-05 17:46:20 -08:00
Olaoluwa Osuntokun 0952b68e64
multi: retain original copyright on files copied/modified from btcsuite
Early in the lifetime of the project here were a few files we either
copied entirely, or used as the basis for code within lnd. Before this
PR, this was not recognized by retaining the original copyright. With
this commit, we remedy that by explicitly noting the copyright in the
relevant files.

Fixes #423.
2017-11-27 16:19:36 -08:00
Laura Cressman 7408aa6c8d config+pathfind_test+notifications_test: format and fix newVertex import
Run go fmt so config file is formatted correctly. Also rename
newVertex to NewVertex in pathfind_test and notifications_test
as it is now exported from the routing package.
2017-11-15 16:50:19 -08:00
Laura Cressman ed6ad22e85 config+server+networktest: make trickleDelay configurable
Add option to set trickleDelay for AuthenticatedGossiper in
command line, with default value of 300 milliseconds. Pass this
value to newServer, which uses it when creating a new instance of
AuthenticatedGossiper. Also set this value to 300 milliseconds when
creating nodes in integration tests.
2017-11-15 16:50:19 -08:00
Johan T. Halseth f1c7dc1cbd config: add --noencryptwallet flag
This commit add the --noencryptwallet flag to lnd config, to be
used by users wanting to disable wallet encryption.
2017-10-19 19:17:35 -07:00
Olaoluwa Osuntokun dff3ad05f0
config: add sanity check to ensure either BTC or LTC is specified 2017-10-17 19:44:15 -07:00
Olaoluwa Osuntokun 7a2ce62346
config+lnd: add new option --cpuprofile for writing cpuprofile to file
In this commit we add a new option to lnd, cpuprofile. With this option
we add additional telemetry hooks into and, allowing users to generate
CPU profiling files to measure hot spots within the daemon.
2017-10-14 17:08:34 -07:00
Conner Fromknecht 74322a99be config+htlclink+peer: htlc hodl mode!
This commit adds a new debug mode for lnd
  called hodlhtlc. This mode instructs a node
  to refrain from settling incoming HTLCs for
  which it is the exit node. We plan to use
  this in testing to more precisely control
  the states a node can take during
  execution.
2017-09-19 11:31:52 -07:00
Olaoluwa Osuntokun 53500127e3
test+config: add new --nobootstrap option to disable connection bootstrapping
This commit adds a new config option to allow callers to optionally
disable connection bootstrapping. This may be desirable for several
reasons, but primary, we add this so we can keep our integration tests
under the same context as before bootstrapping existed.
2017-09-03 17:05:05 -07:00
Olaoluwa Osuntokun 9f0efddc20
multi: switch from btcrpcclient to rpcclient 2017-08-24 18:54:24 -07:00
Olaoluwa Osuntokun 625b80b311
config: update default port to be 9735 to match BOLT-0001 2017-08-22 00:54:10 -07:00
Olaoluwa Osuntokun e0bed8bc27
config: use a single global macaroon database, scope macaroons in datadir
This commit modifies the way that we create the macaroon database, and
also create the initial macaroons themselves. Rather than creating a
new macaroon DB for each chain, we instead create a single instance for
all chains. Additionally, if the datadir has been modified, and the
macaroon paths haven’t been modified, the macaroons are now scoped to
those paths.
2017-08-22 00:53:38 -07:00
Alex 922b065de5 main: integrate macaroons into config, startup, and RPC server 2017-08-17 19:20:41 -07:00
Olaoluwa Osuntokun 629793a249
config: add configuration options for autopilot mode 2017-08-10 21:26:52 -07:00
Alex 59f9065213 rpc: force TLS for both grpc endpoint and grpc gateway 2017-08-03 18:21:22 -07:00
Olaoluwa Osuntokun 828c650bbc
config: add new command line param --defaultchanconfs
This commit adds a new command line option that allows clients to
specify a default value to use when responding to a new channel funding
request. In a future change, a pure mapping will be added, with the
command line option having higher precedence.
2017-07-30 20:21:51 -07:00
Christian Decker 352461d551 config: add regtest support to lnd
Support for regtest allows us to create integration tests to verify
interoperability with other implementations. This seems to work, and
allows to connect to `btcd` and indirectly to `bitcoind` so we can run
lnd on the same network as eclair and c-lightning.

For details about my integration framework check this repo:
cdecker/lightning-integration
2017-07-11 16:54:43 -07:00
Max Fang dc0ab06d91 config: Specify gRPC proxy port with --restport command line arg 2017-07-05 11:57:12 -07:00
Andrey Samokhvalov aed2e5865f test: hack fix of panic by disabling btcrpcclient log 2017-06-25 14:19:56 +01:00
Andrey Samokhvalov 8fa2b95c12 lnd: remove seelog logger
The btclog package has been changed to defining its own logging
interface (rather than seelog's) and provides a default implementation
for callers to use.

There are two primary advantages to the new logger implementation.

First, all log messages are created before the call returns.  Compared
to seelog, this prevents data races when mutable variables are logged.

Second, the new logger does not implement any kind of artifical rate
limiting (what seelog refers to as "adaptive logging").  Log messages
are outputted as soon as possible and the application will appear to
perform much better when watching standard output.

Because log rotation is not a feature of the btclog logging
implementation, it is handled by the main package by importing a file
rotation package that provides an io.Reader interface for creating
output to a rotating file output.  The rotator has been configured
with the same defaults that btcd previously used in the seelog config
(10MB file limits with maximum of 3 rolls) but now compresses newly
created roll files.  Due to the high compressibility of log text, the
compressed files typically reduce to around 15-30% of the original
10MB file.
2017-06-25 14:19:56 +01:00
Olaoluwa Osuntokun a95d56741d
config: don't log to stderr if lnd.conf isn't found
This commit fixes a bit of a wart in the configuration file handling
wherein if the config file isn’t found, an error was printed to stderr.
At times, this would cause the testing framework to erroneously mark as
test as failed. Instead, we now keep a particular config file error,
and check that, printing to a warning log level.
2017-06-19 16:44:30 +02:00
Olaoluwa Osuntokun 4b29c70c45
lnd: rename light client cmd line option to `--neutrino.X=K` 2017-06-05 19:23:09 -07:00