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.
This commit is contained in:
Elle Mouton
2024-11-11 16:18:02 +02:00
parent 755065b6ab
commit 6c008ff8fb
6 changed files with 66 additions and 2 deletions

View File

@@ -1802,6 +1802,7 @@ func (c *Config) ImplementationConfig(
),
WalletConfigBuilder: rpcImpl,
ChainControlBuilder: rpcImpl,
GraphProvider: rpcImpl,
}
}
@@ -1813,6 +1814,7 @@ func (c *Config) ImplementationConfig(
DatabaseBuilder: NewDefaultDatabaseBuilder(c, ltndLog),
WalletConfigBuilder: defaultImpl,
ChainControlBuilder: defaultImpl,
GraphProvider: defaultImpl,
}
}