Commit Graph

340 Commits

Author SHA1 Message Date
Oliver Gugger
842221aab2
config: move directory creation to after path fixes
Fixes #5927.
This commit moves the code that attempts to create parent directories to
the correct place _after_ we've adjusted all path values to point to the
correct places. Before this commit the macaroon and tor paths would
point to their default locations, even if the --lnddir flag was
specified.
2021-11-08 22:39:41 +01:00
Oliver Gugger
338afef862
lnd: standardize printing to stdout
With this commit we standardize the error messages in the config parsing
section of the main package. We only print to stdout/stderr in a single
place and also make sure the same error is printed to the log (which
might or might not yet be initialized at that point).
2021-11-08 15:12:56 +01:00
Oliver Gugger
c02bf19fc5
config: fix reflection parsing in LiT
In the case where lnd's config struct is embedded inside another struct
(for example in lightning-terminal), the flag won't be found under its
original name. So we try to also look it up under the prefixed name.
2021-10-26 17:46:21 +02:00
Olaoluwa Osuntokun
94b7b71809
Merge pull request #5689 from guggero/remote-signer
Support remote signing over RPC
2021-10-18 18:39:17 -07:00
Oliver Gugger
9cae7ad3c2
multi: add remote RPC signing wallet implementation 2021-10-14 15:42:49 +02:00
Oliver Gugger
9fa9dd8e43
multi: extract key ring creation from chain control
To make it possible to supply our own implementation of a secret key
ring, we extract that part from the chain control and split the whole
chain control creation into two parts.
2021-10-14 15:42:47 +02:00
yyforyongyu
f41f5c7fa6
multi: add tor connection healthcheck
This commit adds a new health check, tor connection, to our liveness
monitor. A monitor refactor is applied to the server creation such that
the scope of health check creation is managed within one function.
2021-10-11 13:11:55 +08:00
Oliver Gugger
e1da1f8941
multi: extract wallet initialization
With this commit we extract the wallet creation/unlocking and
initialization completely out of the main function. This will allow us
to use custom implementations in the future.
2021-10-08 12:13:15 +02:00
Oliver Gugger
f6d7e70f51
multi: extract database initialization 2021-10-08 12:08:25 +02:00
Oliver Gugger
0e279eb15a
multi: refactor external subserver config
As a preparation for making more and more implementation details
configurable, we add a new ImplementationCfg struct that houses all the
interfaces that can be defined externally.
2021-10-08 12:08:23 +02:00
eugene
702b3a3258
multi: introduce config-level DustThreshold for defining threshold 2021-09-30 13:44:35 -04:00
ErikEk
d5463818a8 bbolt sync-freelist ignored 2021-09-27 06:49:56 +01:00
Oliver Gugger
918e021177
config+sample-lnd.conf+lncfg: add RPC middleware config 2021-09-20 13:05:47 +02:00
Olaoluwa Osuntokun
ec3af13081
Merge pull request #5410 from adriansmares/feature/add-hybrid-mode
Add Tor hybrid connectivity mode
2021-08-22 12:05:25 -07:00
Oliver Gugger
1e27f491c7
multi: make decayed log DB remote compatible
Even though the sphinx router's persistent replay log is not crucial in
the operation of lnd as its state can be re-created by creating a new
brontide connection, we want to make lnd fully stateless and therefore
have the option of not storing any state on disk.
2021-08-04 14:55:53 +02:00
Oliver Gugger
6043113857
config: make sure network dir is created
The wallet and macaroon databases are the first files that are created
for a new node. When initializing those databases, the parent directory
is created if it does not exist.
With both of the databases now potentially being remote, that code that
creates the parent directory might never be executed and we need to do
that manually when parsing the configuration.
Otherwise we run into an error when we later try to create our default
macaroons in that folder and it doesn't exist.
2021-08-04 14:55:52 +02:00
Oliver Gugger
9138c8abac
multi: rename local and remote chan DBs
As a preparation to not have a local and remote version of the database
around anymore, we rename the variables into what their actual function
is. In case of the RPC server we even directly use the channel graph
instead of the DB instance. This should allow us to extract the channel
graph into its own, separate database (perhaps with better access
characteristics) in the future.
2021-08-04 14:55:50 +02:00
Adrian-Stefan Mares
3378ad0120 config+lnd+tor: Update naming 2021-08-01 14:28:32 +02:00
Adrian-Stefan Mares
c4221c3c3a config+lnd: Update Tor configuration for hybrid node mode 2021-07-10 19:16:58 +02:00
Oliver Gugger
6ca38bc815
lnd+config+sample-lnd.conf: add wallet-unlock-allow-create flag
As requested by users of node bundle software. They want to use the
wallet-unlock-password-file configuration option in their
default/template config file. This makes the first-time lnd setup a bit
more tricky since lnd will fail with an error if no wallet exists yet
while that config option is used.
The new wallet-unlock-allow-create option instructs lnd to not fail if
no wallet exists yet but instead spin up its unlocker RPC as it would
without the wallet-unlock-password-file being present.
This is not recommended for auto-provisioned or high-security systems
because the wallet creation RPC is unauthenticated and an attacker could
inject a seed while lnd is in that state.
2021-07-01 11:10:25 +02:00
Wilmer Paulino
b213402722
config: support auto rpc config with bitcoind signet
This allows lnd to automatically retrieve the RPC credentials when
attempting to connect to a signet bitcoind node.
2021-06-01 16:22:10 -07:00
Olaoluwa Osuntokun
0ed72b8c6a
Merge pull request #5025 from guggero/signet
Add basic bitcoin signet support
2021-05-26 18:19:57 -07:00
Joost Jager
42f4afef75
multi: add random coin selection 2021-05-24 20:09:56 +02:00
Oliver Gugger
4460903399
multi: add signet parameters
With this commit we make lnd compatible with the public signet test
network.
2021-05-18 13:06:03 +02:00
Olaoluwa Osuntokun
86c5e483b2
Merge pull request #5206 from carlaKC/4987-heightexpirywatcher
invoices: add height based expiry watcher
2021-05-12 13:41:52 -07:00
Olaoluwa Osuntokun
93730088c5
Merge pull request #5256 from guggero/wallet-unlock-file
Auto-unlock wallet from password file
2021-05-12 13:41:30 -07:00
carla
34de5922ed
multi: add height-based invoice expiry
This commit adds height-based invoice expiry for hodl invoices
that have active htlcs. This allows us to cancel our intentionally
held htlcs before channels are force closed. We only add this for
hodl invoices because we expect regular invoices to automatically
be resolved.

We still keep hodl invoices in the time-based expiry queue,
because we want to expire open invoices that reach their timeout
before any htlcs are added. Since htlcs are added after the
invoice is created, we add new htlcs as they arrive in the
invoice registry. In this commit, we allow adding of duplicate
entries for an invoice to be added to the expiry queue as each
htlc arrives to keep implementation simple. Our cancellation
logic can already handle the case where an entry is already
canceled, so this is ok.
2021-05-11 08:45:29 +02:00
Conner Fromknecht
2ecd1de713
config: expose distinct accept-amp flag
This mirrors the accept-keysend flag, but also permits users to
eventually toggle off keysend separately from AMP.
2021-05-10 22:02:15 -07:00
Oliver Gugger
571d00b32c
config+lnd: add wallet-unlock-password-file option
In automated or unattended setups such as cluster/container
environments, unlocking the wallet through RPC presents a set of
challenges. Usually the password is present as a file somewhere in the
container already anyway so we might also just read it from there.
2021-05-06 10:07:04 +02:00
Andras Banki-Horvath
d161b34ee5
lnd: integrate leader elector to lnd main
This commit also changes the order of DB init to be run after the RPC
server is up. This will allow us to later add an RPC endpoint to be used
to query leadership status.
2021-05-04 17:33:08 +02:00
Andras Banki-Horvath
44e312ace9
etcd: remove (unused) etcd root bucket prefix
This commit removes the unused prefix from the etcd backend config as
etcd key space separation in LND is implemented by using namespaces
instead.
2021-05-04 17:32:59 +02:00
Olaoluwa Osuntokun
98b0b34bb4
Merge pull request #5237 from guggero/ws-bi-di
REST: Enable support for bi-directional streaming RPCs over REST, fix ping/pong support
2021-04-29 15:55:00 -07:00
Oliver Gugger
5df69cf93f
config+lnd: make WebSocket interval/wait configurable
To make it possible to adapt the WebSocket ping interval and pong wait
time to custom situations, we add new configuration flags to customize
them.
2021-04-29 10:39:54 +02:00
Elle Mouton
6702c79216 multi: add block cache size config
This commit adds block cache size to the main lnd config along with the
chainreg config.
2021-04-28 09:46:11 +02:00
Oliver Gugger
2e9e4567ee
Merge pull request #5135 from GameXG/master
lnd: fix #1990 LND can't read .cookie file in Bitcoin datadir (Windows 10)
2021-04-23 08:41:26 +02:00
Conner Fromknecht
213b264e4c
Merge pull request #5187 from bottlepay/config-commit-time
config: add commit time parameter
2021-04-09 16:44:40 -07:00
Joost Jager
ffd346e2e1
config: add channel commit batch size parameter 2021-04-09 15:10:43 +02:00
Joost Jager
a181d26287
config: add channel commit interval parameter 2021-04-09 15:10:42 +02:00
Wilmer Paulino
56c536583f
lncfg: add new PrunedNodeMaxPeers config option/flag 2021-04-06 14:55:19 -07:00
Jonathan Underwood
786568fa46
cert: allow cert expiry to be set in config 2021-04-05 20:23:33 -07:00
eugene
8b463fbc2b
lnd: optionally listen on localhost for better security
The --profile flag now accepts both a port and a host:port string.
If profile is set to a port, then pprof debugging information will
be served over localhost. Otherwise, we will attempt to serve pprof
information on the specified host:port (if we are allowed to listen
on it.)

We default to the safe option as if the port is connectable, anybody
can connect and see debugging information.

See: https://mmcloughlin.com/posts/your-pprof-is-showing
2021-04-01 12:14:24 -04:00
GameXG
2030b506b1 lnd: fix #1990 LND can't read .cookie file in Bitcoin datadir (Windows) 2021-03-24 21:47:55 +08:00
Hampus Sjöberg
ada1bc701c signal: handle shutdown properly
This addresses issues related to the mobile lnd builds, where
calling `stopDaemon` and subsequently calling LndMobile's `Start`
results in crash.
2021-03-18 12:54:25 +01:00
Wilmer Paulino
dcac5a87f4
lncfg: expose channel update rate limiting options 2021-03-16 11:42:29 -07:00
Elle Mouton
3b412ce50f multi: allow setting target confs for co-op close
This commit adds a new config option: "--coop-close-target-confs"
which allows a user to override the default target confirmations of 6
that is used to estimate a fee rate to use during a co-op closure
initiated by a remote peer.
2021-03-04 13:04:41 +02:00
Oliver Gugger
1a2cb9b975
config: clean and expand backup file path
Because the CleanAndExpandPath function wasn't applied to the backup
file path, any path that contained a tilde for the home directory didn't
work.
2021-02-12 11:14:36 +01:00
Conner Fromknecht
fcd5cb625a
config: expose gossip.pinned-syncers for conf
The pinned syncer set is exposed as a comma-separated list of pubkeys.
2021-01-29 00:19:47 -08:00
carla
4093b2ae45
config: increase chain backend healthcheck timeout and backoff 2021-01-14 22:07:31 +02:00
Oliver Gugger
236294622e
config+lncfg+sample-lnd.conf: fix feeurl documentation
A new top level feeurl option was added recently to replace the neutrino.feeurl
option. The new option was never added to the sample config file and the
text was never updated to reflect that the option is required for
neutrino on mainnet. We fix this and also add a valid mainnet example
URL to the sample config file.
2021-01-11 09:27:19 +01:00
eugene
caa0f5da6a multi: move and export funding-related vars to funding package
Also moves the lnd global MaxFundingAmount to server.go
2020-12-17 09:36:34 -05:00