Commit graph

22 commits

Author SHA1 Message Date
Elle Mouton
92d4aa0e06
multi: move RequiredPermissions to dedicated dir
This commit moves the RequiredPermissions map to its own directory so
that projects importing the permissions list dont need to import all the
dependencies of the pool package.
2022-06-14 15:07:39 +02:00
Elle Mouton
599f26528c multi: use lndclient MacaroonService
Since the code for creating and using a macaroon service is the same for
multiple projects (pool, loop, litd etc), the code has been unified in
lndclient. So this commit removes the macaroon service code and instead
uses the lndclient code.
2022-01-17 16:04:03 +02:00
Turtle
5b44ae53de
pool: conditionally create default macaroon file
In some cases we don't want the default macaroon file to be created on
disk, so we allow passing in a boolean that toggles the macaroon
creation.
2021-11-04 14:09:02 +01:00
Oliver Gugger
8be226351d
macaroons+server: close macaroon DB on server shutdown
In the integration tests we stop the pool daemon but don't exit the main
process. So it can happen that the underlying bbolt DB isn't properly
closed and when the daemon is started again during the test it runs into
a timeout. We fix this by properly closing the DB when the service is
stopped.

The macaroon service doesn't close the backend anymore because in the
lnd context the backend connection could be a shared connection to a
remote DB that we don't want to close when we start/stop the service
itself.
2021-10-28 16:05:58 +02:00
Oliver Gugger
429b28b110
multi: prepare for upcoming lnd v0.14.0-beta release 2021-10-20 19:25:54 -07:00
Oliver Gugger
e111facc28
rpcserver+poolrpc: add ListSidecars and CancelSidecar RPCs
With this commit we add two new RPCs for handling sidecar tickets.
ListSidecars will show all sidecar tickets known to the local database,
including those where our node is on the receiving end of a sidecar
channel.
CancelSidecar will cancel a specific sidecar ticket. If an order was
created for it, that bid order will be canceled. Doing so will make sure
the ticket isn't executed any further.
2021-09-29 15:41:34 +02:00
Oliver Gugger
a5cf85aba2
multi: add DecodeSidecarTicket RPC
To make it possible to decode a sidecar ticket through RPC instead of
only relying on the output of the CLI, we add the DecodeSidecarTicket
RPC method to the trader daemon.
2021-09-22 17:00:43 +02:00
Oliver Gugger
f38eeaf933
multi: bump lnd to version v0.13.0-beta.rc3 2021-05-25 20:25:16 +02:00
Oliver Gugger
ddbc7444d5
poolrpc+rpcserver: implement QuoteOrder RPC
We create an RPC wrapper around the new order.NewQuote function with the
goal of replacing the calculation that currently only exists in the CLI
with an actual RPC call.
2021-05-05 15:57:34 +02:00
Oliver Gugger
16fc005a61
macaroons+clientdb: add timeout to DB open
To make sure we don't just block for forever if another Pool daemon
process is already running, we add a timeout and error out if obtaining
the unique file lock fails after 5 seconds.
2021-04-27 10:19:55 +02:00
Oliver Gugger
15eeee2a3e
multi: add sidecar offer/register/expect RPCs
With this commit we add the ability to both create/expect a sidecar offer as a
provider as well as registering an offer as the recipient to the main
RPC server.
2021-04-07 14:14:10 +02:00
Oliver Gugger
d7ed2a257e
macaroons: add permissions for GetInfo and StopDaemon
This commit adds the required macaroon permissions for the two new RPC
methods added in the previous commit.
We don't want to introduce a new permission that didn't exist before
because that would mean all users would need to re-create their macaroon
to use the commands. Therefore we use the account:write permission for
the shutdown command as that is probably the most sensitive permission
anyway as it gives access to on-chain funds.
2021-02-02 09:57:16 +01:00
Oliver Gugger
7f1f29cf58
macaroons: pass root key ID in context 2021-01-11 13:19:10 +01:00
Oliver Gugger
54d22d41ac
multi: bump lnd dep version 2021-01-11 13:19:09 +01:00
Wilmer Paulino
bcdd267e22
rpc: add RenewAccount RPC 2021-01-08 14:02:25 +01:00
Oliver Gugger
fde059c096
poolrpc: add batch query RPCs 2020-11-30 23:44:22 +01:00
Wilmer Paulino
d7e74bf97e
rpc: add new NextBatchInfo RPC 2020-10-30 16:28:02 -07:00
Olaoluwa Osuntokun
032649b183 rpc+auctioneer: implement new NodeRatings end point 2020-10-09 15:55:16 -07:00
Olaoluwa Osuntokun
a511aea4d9 rpc: add LeaseDurations to set of macaroon perms 2020-10-06 16:00:50 -07:00
Oliver Gugger
c69325bf91
mod+macaroons: bump to lnd v0.11.1-beta.rc3
To make sure we can use the latest version of pool in LiT, we need to
make sure pool compiles against the actual v0.11.1 branch of lnd. There
were some conflicting changes to the macaroon service that didn't make
it to the branch that we need to roll back. Those changes don't affect
pool at all as we were always using the default root key ID anyway.
2020-09-18 09:00:11 +02:00
Olaoluwa Osuntokun
6faea07291
macaroons: add Leases to macaroons permission list 2020-09-17 17:40:24 -07: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