We want to be able to pass different DB implementations to NewService.
In preparation for this, we make it implementation agnostic by letting
it take a `Store` instead of constructing one itself.
This this change, we also let LiT handle the closing of the accounts
Store instead of the accounts service
So that it is set correctly by the time we potentially want to special
case the handling of the bakesupermacaroon method. This is required in
the case where the full LND connection takes long to create due to it
blocking on LND being fully synced.
When lnd isn't marked as fully ready yet, we didn't allow any REST
methods through. But to allow creating a wallet through REST, we also
need to allow these methods.
We pass a random lnd connection identifier to the rule enforcer that is
unique per lnd connection lifetime. It is used to generate unique
request identifiers that amend the non-unique request identifiers that
are passed from lnd.
Loop `v0.28.0-beta` requires the minimum required lnd version to be set
to `v0.17.0`, and this commit therefore updates the litd requirement
accordingly.
Add the accounts service to status manager. This will allow us to query
the status of the accounts service and see if it is running or not.
For incoming gRPC requests to the accounts service, we also use the
status manager to check if the accounts service is running or not to
determine if we should let the request through or not.
Pass the status manager to the sub-server manager so that the sub-server
manager can inform the status manager of any sub-servers that have
started or failed to start.
Initialise an instance of the status manager in LightningTerminal.
Register its gRPC and REST endpoints and also add its method to the set
of LiT whitelisted permissions.
We eventually want a few Lit grpc servers to continue functioning even
if LND did not start up properly. This means that we need to register
these servers with LiT's grpc server instead of using LND's.
Because of this change, we also need to update the itest a bit so that
calls to the proxy server are never expected to succeed if the call is
made via the LND port.
Modify the sub-server Manager's AddServer method to take an `enabled`
boolean so that it can handle what to do with a disabled sub-server.
This will come into play in a future commit which adds a status server.
In this commit, we ensure that when we wait on the macaroon channel for
the macaroon from the integrated LND, that we also listen to other exit
signals such as the interceptor, lndQuit chanel and the error channel.
This is to prevent shutdown from blocking forever in the case where
there was an issue preventing LND from sending the initial macaroon.
Enable to start litd with taproot asset subserver disabled.
The default mode for the new sub-server is "Disabled"
Add coverage in itests for flows with some subservers disabled (based on
Elle's #537)