Commit Graph

71 Commits

Author SHA1 Message Date
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
Johan T. Halseth
b8cadf881c
fundingManager: use NotifyWhenOnline when sending fundingLocked.
The fundingManager will register with the server to get notified
when the targetted peer comes online, in case of a failed send
of the fundingLocked message. This is necessary because if the
peer is not connected yet (or was disconnected while we were
waiting for the funding tx to confirm), we cannot continue the
the opening process before the peer successfully has received
the fundingLocked.
2017-10-02 13:29:52 +02:00
whythat
1379488e72 macaroons: rename PermissionsConstraint to AllowConstraint 2017-09-19 16:46:20 -07:00
whythat
7df503575c macaroons: add error reporting for macaroon constraints 2017-09-19 16:46:20 -07:00
whythat
a6b9155150 macaroons: use constraint layer for macaroon tweaking 2017-09-19 16:46:20 -07:00
John
8fc14a7308 rpc: add additional go 1.8 TLS cipher suites 2017-09-19 05:45:31 +02: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
Olaoluwa Osuntokun
01b0ddf1c5
lnd+rpc: update RPC responses to convert mSAT to SAT 2017-08-22 00:52:56 -07:00
Alex
f67ce4e6d7 main: fix TLS cert autogen and server configuration 2017-08-18 12:05:08 -07:00
Alex
922b065de5 main: integrate macaroons into config, startup, and RPC server 2017-08-17 19:20:41 -07:00
Olaoluwa Osuntokun
ece1d09a9f
lnd: initialize an autopilot.Agent instance if set in the config file 2017-08-10 21:40:16 -07:00
Conner Fromknecht
d3dc546108 lnd+rpcserver: use new public server API 2017-08-10 16:14:01 -07:00
Johan T. Halseth
849d0b93b1 fundingManager: persist state in opening process.
Persists the state of a channel opening process after funding
transaction is confirmed. This tracks the messages sent to
the peer such that the process can be continued in case of a
restart. Also introduces that the receiver side forgets about
channel if funding transaction is not confirmed in 48hrs.
2017-08-10 13:14:25 -07:00
Johan T. Halseth
5c89ec6288 fundingManager: let CurrentNodeAnnouncement return copy instead of ref 2017-08-08 12:29:27 -07:00
Olaoluwa Osuntokun
43b736225b
multi: add new method to generate fresh node announcments 2017-08-04 18:32:33 -07:00
Alex
59f9065213 rpc: force TLS for both grpc endpoint and grpc gateway 2017-08-03 18:21:22 -07:00
Johan T. Halseth
e2112702e7 fundingmanager: send node announcements after channel open.
Make the fundingmanager send an updated node announcement
each time it opens a new channel. This is to make sure
our node announcement is propagated in the network, since
peers will ignore our node announcements if we haven't
opened any channels yet.
2017-08-02 15:58:58 -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
Olaoluwa Osuntokun
db10772bd0
lnd: add initial skeleton functions for RequiredRemoteDelay+ NumRequiredConfs 2017-07-30 17:52:11 -07:00
Olaoluwa Osuntokun
a73589f3e9
lnd: properly initialize LightningWallet with new config 2017-07-30 17:52:07 -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
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
b47ffde4ad
funding: use default routing policy when advertising initial channel routing policy 2017-06-17 00:15:38 +02:00
Olaoluwa Osuntokun
e43412b820
build: update glide files to add neutrino, latest roasbeef forks 2017-06-05 19:41:04 -07:00
Olaoluwa Osuntokun
4b29c70c45
lnd: rename light client cmd line option to --neutrino.X=K 2017-06-05 19:23:09 -07:00
Olaoluwa Osuntokun
aec8c8dc77
lnd: decouple rpcServer from server, wait till chain synced before starting server
This commit overhauls the way that lnd is created with the goal of
ensuring the chain backends are fully synced up before the daemon
itself starts. The rpcServer has been slightly decoupled from the
server itself s.t we can start the rpcServer independently of the
server. This is required as we’ll now wait (unless we’re in simnet
mode) for the chain to fully sync up before we even _start_ any of the
server’s goroutines.
2017-06-05 19:22:12 -07:00
Olaoluwa Osuntokun
593ba7c8f0
lnd: newChainControlFromConfig can now create light client backed chainControl
This commit finishes up the implementation of newChainControlFromConfig
in order to properly initiate the members of the chainControl struct
when the new light client mode (neutrino). With this lnd is now able to
switch over to either mode with a simple configuration change.
2017-06-05 19:14:41 -07:00
Olaoluwa Osuntokun
770d6b136f
chainregistry: add new method to automatically create chainControl 2017-06-05 18:48:12 -07:00
Olaoluwa Osuntokun
67791755af
lnd: use a default temporary static fee of 50 sat/byte for BTC 2017-05-16 19:12:27 -07:00
bryanvu
abe2e502d5 lnwallet: add FeeEstimator interface, StaticFeeEstimator implementation
This commit adds the FeeEstimator interface, which can be used for
future fee calculation implementations. Currently, there is only the
StaticFeeEstimator implementation, which returns the same fee rate for
any transaction.
2017-05-15 20:26:11 -07:00
Olaoluwa Osuntokun
a75439f56b
lnd: properly initialize ChannelRouter with FilteredChainView 2017-05-11 15:20:57 -07:00
Olaoluwa Osuntokun
6acd177c33
lnd: specify formatting directive in new error logging 2017-05-02 20:03:19 -07:00
Olaoluwa Osuntokun
c66c7473bf
lnd: register selected chain within chainRegistry on boot
This commit modifies the initialization logic within lnd.go to
recognize which chain was selected by the user and to set the
parameters accordingly. With this commit, lnd is now able to switch
between chains within nothing more than a toggle of config paramters!
2017-05-02 19:57:59 -07:00
Olaoluwa Osuntokun
c41d673c7b
lnwallet/btcwallet: update WalletController imp to latest btcwallet API 2017-04-23 19:19:22 -07:00
Olaoluwa Osuntokun
eb37dba3f6
funding: modify fundingManager config to use SignMessage for ann's
This commit modifies the fundingManager config to use the a SignMesage
function rather than two distinct functions for singing one half the
channel announcement proofs. This change unifies the signing of
messages under a single abstraction: the MessageSigner interface.
2017-04-14 11:17:48 -07:00
Olaoluwa Osuntokun
846863ca66
lnd: avoid duplicating the help message (-h flag) 2017-04-01 20:14:08 +02:00
Andrey Samokhvalov
d4055d7830 discovery+funding: add validation of the announcement messages
Add validation functions and include validation checks in the
annoncement process function.
2017-03-29 19:49:05 -07:00
Andrey Samokhvalov
fd97a4bd19 lnd: partially fix golint warnings 2017-03-13 16:30:23 -07:00
Olaoluwa Osuntokun
19a7778a7d
lnd: don't attempt to serve the possible non-existent swagger file 2017-02-21 01:42:47 -08:00
Trevin Hofmann
40c7bac3aa multi: fix a variety of typos throughout the repo 2017-01-17 17:02:56 -08:00
Olaoluwa Osuntokun
ad76899a57
config+test: use default port for RPC server if one isn't specified
This commit alters the configuration parsing a bit along with the
documentation to expect the RPCHost configuration paramter to also have
the target port specified. If the port isn’t included, then the default
btcd RPC port for that chain is used.

Additionally, within the integration testing framework, when creating
the lnd nodes, we now use the configuration from the btcd harness to
set the proper RPC host.
2017-01-05 13:18:26 -08:00
Olaoluwa Osuntokun
b85c1c3b2a
lnd: correct minor typo in error message if server fails to start 2016-12-27 16:43:41 -08:00
Olaoluwa Osuntokun
597b4ee3d3
channeldb: Open is no longer dependant on a specific set of chain params 2016-12-27 16:43:19 -08:00
Olaoluwa Osuntokun
93cbfdbd60
htlcswitch: add new CloseType enum to account for all closure types 2016-11-28 18:44:22 -08:00
Olaoluwa Osuntokun
b70d1f8cfe
channeldb: move .SyncVersions() into .Open(), minor migration cleanups
This commit unexports the SyncVerions PR, in favor of making it private
and moving it into the .Open() method. With this change, callers no
longer need worry about ensuring the database version is up to sync
before usage, as it will happen automatically once the database is
opened.

This commit also unexports some additional variables within the package
that don’t need be consumed by the public, and exports the
DbVersionNumber attribute on the meta struct. Finally some minor
formatting fixes have neen carried out to ensure the new code more
closely matches the style of the rest of the codebase.
2016-11-22 16:00:02 -06:00
Andrey Samokhvalov
25167361d2 lnd: add sync logic in lnd main 2016-11-22 15:25:21 -06:00
Olaoluwa Osuntokun
8053f841e4
lnd: ensure the gRPC listener is closed once the daemon exits 2016-11-16 12:42:05 -08:00
Olaoluwa Osuntokun
ac43de94f6
lnd: remove interactive shell 2016-10-27 19:54:44 -07:00
Andrey Samokhvalov
19d8abade8 config: add --pendingchannel lnd flag 2016-10-22 02:11:18 +03:00
Olaoluwa Osuntokun
e038491f8a
lnd: fix build error for go 1.6.3, use experimental context import
This commit fixes a build error for go 1.6.3. Before go 1.7, the
context package was under the experimental go packages, therefore to
maintain compatibility across our currently supported versions, we must
use the ‘/x/net’ import path.
2016-10-15 15:35:35 -07:00