Commit Graph

77 Commits

Author SHA1 Message Date
2451e6ae50 lnd: fix orders when initializing subsystem loggers
This commit fixed a wrong ordering of initializing subsystem loggers. We
need to make sure "third party" loggers are initialized first such that
when we customize the names later in `lnd`'s packages, the overwriting
of the logger names will take effect.
2023-06-20 18:34:16 +08:00
635cffa871 multi: add sub-server dep 2022-04-30 08:55:49 +02:00
e4e0935816 lnrpc/peers: skeleton logic for updateNodeAnnouncement
Basic logic for the endpoint:

- Get the current nodeAnn information
- Calculate modifications
- Apply modifications
- Return changes
2022-04-01 18:36:21 -07:00
ffee7d1bcf multi: fix newly detected linter issues 2022-02-10 11:02:02 +01:00
1a8f094503 lnrpc: add the devrpc development only subserver + devrpc.ImportGraph
This commits adds the devrpc package which implements a subserver that
adds clean separation for RPC calls useful for development and
debugging. This subserver is only compiled in if the dev tag is set.
Furthermore the commit adds the devrpc.ImportGraph call which can
import a graph dump obtained from another node by calling DescribeGraph.
Since the graph dump does not include the auth proofs, the imported
channels will be considered private.
2022-01-24 17:42:59 +01:00
c24763b3da lnd+lnwallet: add logger for btcwallet+rpcwallet 2022-01-06 13:24:32 +01:00
0b80d4feaa tor: add logging to tor controller 2021-10-11 13:11:53 +08:00
7bde1662e2 multi: move breach arbiter and utxo nursery into contractcourt package
In this commit, we take an initial step towards converting the existing
breach arbiter and utxo nursery logic into contract resolvers by moving
the files as is, into the `contractcourt` pacakge.

This commit is primarily move only, though we had to massage some
interfaces and config names along the way to make things compile and the
tests run properly.
2021-09-27 19:10:31 -07:00
8509d92070 log+rpcperms: add custom RPCP logger to rpcperms package
The custom RPC middleware logic that we are going to add in the next
commits will need to log under their own sub logger so we add one with a
new subsystem name.
2021-09-20 13:05:47 +02:00
e62dbca11a cluster: add cluster package skeleton and LeaderElector interface 2021-05-04 17:33:07 +02:00
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
3c81a5dd73 rpcperms: add RPC interceptor chain
This adds a new package rpcperms which houses the InterceptorChain
struct.  This is a central place where we'll craft interceptors to use
for the GRPC server, which includes macaroon enforcement.

This let us add the interceptor chain to the GRPC server before the
macaroon service is ready, allowing us to avoid tearing down the GRPC
server after the wallet has been unlocked.
2021-03-11 13:05:23 +01:00
dcdf36f410 lnd+funding: move Manager to funding, change references 2020-12-17 10:45:05 -05:00
1b84d07c4d lnd+funding: register funding logger 2020-12-17 09:36:34 -05:00
54c3e98b40 multi: move channel acceptor logic out of rpcserver
This commit moves and partially refactors the channel acceptor logic
added in c2a6c86e into the channel acceptor package. This allows us to
use the same logic in our unit tests as the rpcserver, rather than
needing to replicate it in unit tests.

Two changes are made to the existing implementation:
- Rather than having the Accept function run a closure, the closure
  originally used in the rpcserver is moved directly into Accept
- The done channel used to signal client exit is moved into the acceptor
  because the rpc server does not need knowledge of this detail (in
  addition to other fields required for mocking the actual rpc).

Crediting orginal committer as co-author:
Co-authored-by: Crypt-iQ
2020-11-10 11:38:45 +02:00
5668b335d3 chainreg: register logger 2020-11-09 14:11:31 +02:00
c365a16656 healthcheck: monitor access to chain backend
Add a new health check package which will periodically poll health
check functions and shutdown if we do not succeed after our set number
of attempts. The first check that we add is one for our chain backend,
to ensure that we are connected to a bitcoin node.
2020-08-24 09:35:36 +02:00
nsa
cbd54101f8 multi: remove peer.go, change all references to point to peer pkg 2020-07-06 19:16:07 -04:00
nsa
2d68a64a5b chancloser: new package for cooperative channel closure
Introduces a new chancloser package which exposes a ChanCloser
struct that handles the cooperative channel closure negotiation
and is meant to replace chancloser.go in the lnd package. Updates
all references to chancloser.go to instead use chancloser package.
2020-06-16 20:34:44 -04:00
75f916b026 log+config: remove global RootLogWriter variable 2020-05-27 09:43:59 +02:00
c2516d9352 Merge pull request #4286 from guggero/remove-global-cfg
multi: remove global cfg variable
2020-05-18 19:45:43 -07:00
b195d39ad7 rpc: use existing rpc logger for wtclientrpc
The logger string used to identify the wtclient and wtclientrpc loggers
was the same, leading to being unable to modify the log level of the
wtclient logger as it would be overwritten with the wtclientrpc's one.
To simplify things, we decide to use the existing RPC logger for
wtclientrpc.
2020-05-14 13:35:03 -07:00
bc3909050e multi: rename and export logWriter as RootLogWriter 2020-05-14 14:37:50 +02:00
a25269c4d3 lnrpc/verrpc: add Versioner RPC server 2020-04-10 16:39:23 -07:00
9f1720dea8 build: prevent loggers from overwriting each other.
Previously only the last registered logger would receive debug level
changes.
2019-12-11 15:22:00 +01:00
74c2df658e localchans: log policy update error 2019-12-11 00:17:06 +01:00
f289dbd826 routing: define subsystem constant 2019-12-11 00:17:04 +01:00
d422ebbc66 lnwallet/chanfunding: introduce new channel funding abstractions
In this commit, we introduce a series of new abstractions for channel
funding. The end goal is to enable uses cases that construct the funding
transaction externally, eventually handing the funding outpoint to lnd.
An example of such a use case includes channel factories and external
channel funding using a hardware wallet.

We also add a new chanfunding.Assembler meant to allow external channel
funding in contexts similar to how channel factories
can be constructed. With this channel funder, we'll only obtain the
channel point and funding output from it, as this alone is enough to
carry out a funding flow as normal.
2019-12-02 17:11:32 -06:00
744876003d chanfitness: Add channel event log structure
This commit adds a chanfitness package which will be used to track
channel health and performance metrics. It adds a channel event
structure which will be used to track channel opens/closes and peer
uptime.

The eventLog implements an uptime function which calcualtes uptime
over a given period and a lifespan function which returns the time
when the log began monitoring the channel and, if the channel is
closed, the time when it stopped moitoring it.
2019-10-25 09:51:07 +02:00
94f49192cf lnd: refactor sub logger setup to use new rotating log writer 2019-10-14 14:56:31 +02:00
d3995a73ae build: move log rotator code 2019-10-14 14:56:31 +02:00
ed954785b2 rpc: add unary+streaming interceptors to log all errors
Not all errors that occur when serving client requests in the gRPC
server are logged. As a result, at times, we can be lacking critic
information that can be used to debug issues that pop up. With this PR,
we create a basic streaming+unary interceptor that will log all errors
that occur when servicing calls.

The current format looks something like this in the logs when an error
occurs:

```
[ERR] RPCS: [/lnrpc.Lightning/SendCoins]: decoded address is of unknown format
```
2019-08-06 19:41:41 -07:00
e44445e952 Merge pull request #3354 from carlaKC/peernotify-addpeernotifierservice
Peernotifier: Add Peer Notifier package
2019-08-06 19:34:25 -07:00
74f0c5f00f log: correct NTFR -> ntfrLog mapping
Most likely because of a typo, NTFR was mapping to ntfnLog instead of
ntfrLog.

Originally added in 59e2be5306
2019-08-05 15:21:59 +02:00
4ceceda757 peernotifier: Add peer notifier package for peer online/offline events
This commit adds a peer notifier package which provides clients with
a subscription to peer online and offline events.
2019-08-02 10:15:28 -04:00
8f010abac5 multi: add watchtower client RPC subserver 2019-07-30 15:18:15 -07:00
5266f597fd log: add watchtower client logs 2019-06-13 19:54:18 -07:00
f5eeb05e0a rpcserver+monitoring/config: enable Prometheus monitoring.
Start the Prometheus exporter in rpcserver.go if monitoring is enabled through the
build tag. Also allow users to specify what address they want the Prometheus
exporter to be listening on.
2019-06-11 11:26:09 -07:00
b53899c43c lnd: rename package main->lnd 2019-04-23 20:57:33 +02:00
056decac2a log: hook up chanbackup logger 2019-03-28 17:53:34 -07:00
6b6dd30aa7 routerrpc: register router sub server logger 2019-03-27 11:44:49 +01:00
cb26fd8a17 lnd: introduce the ChannelNotifier.
This commit introduces the channel notifier which is a central source
of active, inactive, and closed channel events.

This notifier was originally intended to be used by the `SubscribeChannels`
streaming RPC call, but can be used by any subsystem that needs to be
notified on a channel becoming active, inactive or closed.

It may also be extended in the future to support other types of notifications.
2019-02-05 18:17:54 -08:00
3545685177 invoicesrpc: create sub server
Sub server implementation is still empty. This is a preparatory
step for adding invoice functionality.
2019-02-01 09:42:35 +01:00
59e2be5306 config: add ChainRPC config 2019-01-21 14:02:00 -08:00
e0c652791b log: add watchtower logs 2019-01-14 19:42:33 -08:00
97f4f10355 log: initialize NANN logger for netann pkg 2019-01-09 13:31:39 -08:00
c1eaf60000 invoices: create package
This commit isolates the invoice registry in a separate package. It is
a preparation for the creation of an invoices sub server.
2019-01-07 23:04:05 +01:00
00376230ff lnrpc+log: add autopilot rpc logger 2018-12-13 12:33:44 +01:00
844698048a log: wire up the new WalletKit logger 2018-12-06 16:25:37 -08:00
16d16cf1b6 log: register logger for new Signer RPC Service, namespace SGNR 2018-11-28 20:57:04 -08:00