Add support of ldk-node#307
Conversation
Feel free to bump this in a preparatory commit in this PR! |
b7eef3c to
8a6efb5
Compare
Add `LdkNode` as a new `LightningNode` implementation backed by ldk-server-client over gRPC-over-HTTPS. Supports keysend via `spontaneous_send`, payment tracking via polling `get_payment_details`, graph queries, and channel capacity reporting. Wire up `NodeConnection::Ldk` in sim-cli parsing so ldk-server nodes can be specified in sim.json alongside LND, CLN, and Eclair nodes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
83e2d28 to
526eb15
Compare
|
Initially I was trying to wire up ldk-node, which is not a daemon and I thought sim-ln could orchestrate ldk-node building, initialization. However it turned out that we want already running and funded nodes with opened channels, so this wasn't an option. Added support of https://github.com/lightningdevkit/ldk-server, which is a reference daemon implementation with external API, it uses ldk-node internally. Please note, that ldk-server has not yet been released, therefore a git reference and a revision is used in Cargo.toml The configuration for ldk-server looks in the following way: Please note that currently it's not possible to guess the network via RPC calls, that's why we need to provide it in the config. This might change in future. |
Happy to go with server, I believe a release is coming soon ™️ ! |
|
Promise to get to review this week - sorry I've been a bit slow but it's on my list! |
Previously we had to specify the network in the config file. Now, as the network field is added to the get-node-info response we can deduce it ourselves.
chuksys
left a comment
There was a problem hiding this comment.
Thanks for working on this! I've done a quick initial code/design review. It looks good so far, but I still need to run some local tests. I'll do that ASAP and get back to you with final feedback.
| }; | ||
|
|
||
| pub struct LdkNode { | ||
| pub struct LdkServer { |
There was a problem hiding this comment.
To align with the naming conventions of the other impls, let's go with LdkServerNode here & elsewhere. Sorry for the back-and-forth!
There was a problem hiding this comment.
Renamed. Force pushed without a new commit.
8337320 to
0c69012
Compare
| Lnd(lnd::LndConnection), | ||
| Cln(cln::ClnConnection), | ||
| Eclair(eclair::EclairConnection), | ||
| Ldk(ldk_server::LdkServerConnection), |
There was a problem hiding this comment.
This should be LdkServer not Ldk.
| NodeConnection::Lnd(c) => Arc::new(Mutex::new(LndNode::new(c).await?)), | ||
| NodeConnection::Cln(c) => Arc::new(Mutex::new(ClnNode::new(c).await?)), | ||
| NodeConnection::Eclair(c) => Arc::new(Mutex::new(EclairNode::new(c).await?)), | ||
| NodeConnection::Ldk(c) => Arc::new(Mutex::new(LdkServerNode::new(c).await?)), |
There was a problem hiding this comment.
This should be LdkServer not Ldk.
0c69012 to
590d5ae
Compare

This PR adds support of ldk-node to sim-ln.
Closes: #26
As ldk-node is not a daemon, before we start we parse the simulation config file and extract all ldk-nodes, build them and start. For that an additional chain source (bitcoind/esplora/electrum) is needed to start.
Before this PR can be merged, an update of used lighting libraries should be merged, as the current ldk-node has newer versions.