Commit graph

33 commits

Author SHA1 Message Date
Oliver Gugger
b9358dec8f
server: allow poold to be used as external subserver
When poold runs in the same process as lnd (in LiT), it hooks itself into
lnd's RPC server as an external subserver. But because the user should
still be able to use the default llm macaroon, the pool daemon must be
able to validate its own macaroons as lnd's macaroon service doesn't
know the root key for it.
2020-09-17 08:37:22 +02:00
Oliver Gugger
1dc624a24a
config+server: add macaroon authentication to pool's server connn
To secure access to pool's RPC server, we add a macaroon authentication
service and its gRPC interceptors to the daemon's server connection.
2020-09-17 08:37:21 +02:00
Oliver Gugger
32e1006ef6
config+server: add TLS to pool's server connection 2020-09-12 09:08:13 +02:00
Oliver Gugger
ce235cbc1d
multi: extract config validation
As a preparation to add more configuration paths for TLS, we first
extract the config validation and path cleanup into its own function.
2020-09-12 09:08:13 +02:00
Oliver Gugger
123522e3b6
lnd+server+run: bump lnd to v0.11.1-beta
We update to the latest lnd version that contains the new flag in
AbandonChannel that we need. Because master is now tagged with
v0.x.99-beta, we can already increase the required version in the
server.
Because we touch this file anyway, let's as well avoid a bug in
lndclient that requires a subserver macaroon to be present even if we
don't need that subserver's functionality.
2020-09-10 13:47:17 +02:00
Olaoluwa Osuntokun
1e0035d3d4
multi: fix import order 2020-09-09 19:55:16 -07:00
Olaoluwa Osuntokun
ffc9c60b13
multi: rename project from llm to pool 2020-09-09 19:55:10 -07:00
Oliver Gugger
8b460f6506
server: embed gRPC server
To make it possible to run the whole daemon as an external subserver in
LiT, we need to embed the gRPC server so we can register it to lnd.
2020-09-03 09:57:39 +02:00
Oliver Gugger
4953d69d9b
server: add StartAsSubserver 2020-09-03 09:57:38 +02:00
Oliver Gugger
4f6b6f01a5
server: add started flag 2020-09-03 09:57:38 +02:00
Oliver Gugger
6a8f4c74fd
server: move client startup into method 2020-09-03 09:57:37 +02:00
Oliver Gugger
5f1be840e4
server: remove cfg helper variable 2020-09-03 09:57:37 +02:00
Oliver Gugger
8605008ec1
server+run: move startup logic into Start method 2020-09-03 09:57:36 +02:00
Oliver Gugger
139be1584d
server+llmd: extract setup code into Run function 2020-09-03 09:57:36 +02:00
Olaoluwa Osuntokun
2cfcad1956
llmd: on start up only query orders that're in a non-terminal state
This lets us avoid querying the server for all orders on start up each
time.
2020-08-28 16:12:52 -07:00
Oliver Gugger
7d9e6bdce3
server: pin required lnd version, block until synced
With this commit we address two issues with the connection to lnd:
First, we didn't specify the required version of lnd even though we used
features of 0.11.0. This is fixed by pinning the version to 0.11.0
explicitly and specifying the subservers that are required to be active.
Second, we didn't wait for lnd to be synced to its chain backend. We use
the new functionality in the lndclient repo that does exactly this.
2020-08-11 19:41:02 +02:00
Oliver Gugger
978950600c
multi: update aperture, use lndclient, remove loop
To get rid of the loop dependency, we update aperture (which now houses
all the LSAT code) and use the standalone lndclient repository.
2020-08-11 19:41:01 +02:00
Olaoluwa Osuntokun
fb3f2b6f76
server: on start up, sync local with remote order state
In this commit, we add some new logic to reconcile our local order state
with what the auctioneer has on start up. However, we'll only update our
local order if the auctioneer shows the order as being cancelled. For
all other cases, we should reconcile that difference if we have a
pending batch that was confirmed while we were offline, or confirmed
after we sent our signature. In this case, we'll log the order nonce
with a warning log-level so users can track down any possible issues.
2020-08-04 18:21:05 -07:00
Oliver Gugger
7ab3b587bd
server: add LSAT store to struct
As a preparation to be able to interact with the LSAT store on the RPC
level, we need to hold a reference to it in the server. So far we also
don't pass the client DB to the RPC server but instead access it through
the server struct. We do the same for the LSAT store.
2020-08-03 11:08:54 +02:00
Olaoluwa Osuntokun
18a825d935
server: add new unary+streaming interceptors to log all RPC errors 2020-07-01 17:52:05 -07:00
Olaoluwa Osuntokun
57fa63c237
multi: rename, fix modules 2020-06-21 19:37:00 -07:00
Olaoluwa Osuntokun
7c9c6dfe2d Merge pull request #84 from Roasbeef/client-fix
client: ensure the auctioneer client is started
2020-05-22 15:29:17 -07:00
Oliver Gugger
8785596960 client: add config option to disable LSAT 2020-05-20 13:53:06 +02:00
Olaoluwa Osuntokun
e691b4dac8 client: ensure the auctioneer client is started
In the integration tests, we start the client manually as part of the
set up process. When the trader is run in a standalone manner, we still
need to ensure the client is started, otherwise the auth handshake can't
take place.
2020-05-19 17:43:28 -07:00
Olaoluwa Osuntokun
55bc067f1d client: add logic to register funding shims and open chans in batch lifecycle
In this commit, we add the missing logic to register for funding shims
when we're the taker of an executed order, and also to establish new
channels after we send OrderMatchAccept when we're the maker of an
executed order.
2020-05-07 19:37:05 -07:00
Olaoluwa Osuntokun
5c795ef264 client: add full lnd client to main server
As a temporary work around, we'll also add a full lnd client, as we'll
need to do things like connect to peers, register for funding shims, and
also open channels. In the future we'll catch up lndclient to add these
new methods so we can use mocks in our unit tests.
2020-05-07 19:37:02 -07:00
Wilmer Paulino
4013f33984 auctioneer: remove irrelevant pending batch on stream establishment
This commit aims to address another gap within the system to ensure
trader pending batch states are as accurate as possible. In a previous
commit, we addressed the case of a trader signing for a batch,
disconnecting and not receiving a Finalize message, and seeing a spend
for an account.

Here, we're interested in determining whether a batch a trader signed
for is actually still relevant to the trader. Since any trader can bail
from a batch, the batch may need to be re-done by the auctioneer, and if
a trader that previously signed for a previous version of the batch
remains disconnected, then they won't be aware of said new batch. At
this point, the trader has a lingering pending batch that's no longer
irrelevant, so we remove it. This logic is tied to the connection
establishment between the trader and auctioneer to ensure we handle the
disconnection and crash case of a trader after signing for a batch.
2020-05-05 13:54:39 -07:00
Wilmer Paulino
f7143b56ae server: move db init from RPC to main server
The auctioneer client will require some database methods in a later
commit, but at the moment of initialization, the database does not yet
exist.
2020-05-05 13:54:38 -07:00
Oliver Gugger
afa03d728b client: expose LSAT identity 2020-04-29 16:19:13 +02:00
Oliver Gugger
9111b99f0b client: add dummy interceptor 2020-04-29 16:18:41 +02:00
Oliver Gugger
42adb28ff5 client: verify batch 2020-04-03 21:50:22 +02:00
Oliver Gugger
7579b158fc client: implement stream RPC 2020-03-04 15:11:08 +01:00
Oliver Gugger
2c88c6de18 client: refactor to start/stop model 2020-02-26 11:59:36 -03:00
Renamed from agorad.go (Browse further)