Commit Graph

9 Commits

Author SHA1 Message Date
Elle Mouton
80070618a7 graph+lnd: add NetworkStats to GraphSource interface
so that the external graph source can be used to query network
information rather than depending on the local graph DB.
2024-11-28 14:52:49 +02:00
Elle Mouton
372883ab81 lnd+graph: add GraphBootstrapper to the GraphSource interface
So that LND can use a different GraphSource for network bootstrapping
and does not need to rely on its local graph db.
2024-11-28 14:52:49 +02:00
Elle Mouton
28415f5ef2 graph+lnd: add various calls to GraphSource
In this commit, we add a bunch of graph methods to the GraphSource, let
DBSource implement it and then we use the graph source for these
methods for the GetNodeInfo, VerifyMessage, DescribeGraph,
GetNodeMetrics, GetChanInfo and GetNodeInfo RPC calls along with peer
alias lookup.
2024-11-28 14:52:49 +02:00
Elle Mouton
bfe6262b29 graph+channeldb: add AddrSource interface to GraphSource 2024-11-28 14:52:49 +02:00
Elle Mouton
237151d9df netann+lnd: add netann.ChannelGraph to the GraphSource interface
And let DBSource implement it.
2024-11-28 14:52:49 +02:00
Elle Mouton
6f3d45f5d9 invoicesrpc: remove invoicerpc server's access to ChannelGraph pointer
Define a new GraphSource interface required by the invoicerpc server and
remove its access to the graphdb.ChannelGraph pointer. Add the new
invoicesrpc.GraphSource interface to the GraphSource interface
and let DBSource implement it.
2024-11-28 14:52:48 +02:00
Elle Mouton
9854bad720 graph: add contexts to the ReadOnlyGraph interface
Since the GraphSource interface may be satisfied by an RPC connection,
it is best practice to pass a context through to any call in the
interface.

The ChanGraphSource implementation, which uses a kvdb backend, does not
make use of the ctx. Any call-sites are for now given a `context.TODO()`
which will all be addressed in follow up commits.
2024-11-28 14:52:48 +02:00
Elle Mouton
aa2480464b graph: add ReadOnlyGraph interface to GraphSource interface
In this commit, we take the existing graphsession.ReadyOnlyGraph
interface and remove its usage of a kvdb.RTx and replace it with a more
abstract `RTx` interface type.

The new GraphSource interface is expanded to include the
graphsession.ReadOnlyGraph interface and the implementation of it,
DBSource, is expanded to include the new methods. It converts the
given RTx to the underlying kvdb read transaction where needed.
2024-11-28 14:52:48 +02:00
Elle Mouton
6c008ff8fb lnd+graph: add GraphSource interface and implementation
This commit adds a new GraphSources interface that LND requires for
graph related read-only queries. As of this commit, the interface is
empty but it will be populated over the next couple of commits. We add
an implementation of this interface backed by a pointer to a
graphdb.ChannelGraph.

The infrustructure is put into place so that the GraphSoure provided to
LND can be overridden by a caller of the lnd.Main function. By default,
LND will satisfy the interface itself via the new `graphsource.DBSource`
struct.
2024-11-28 14:52:48 +02:00