Skip to content

Commit 526eb15

Browse files
randomloginclaude
andcommitted
simln-lib/feat: add ldk-server backend support
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>
1 parent 66daf69 commit 526eb15

5 files changed

Lines changed: 424 additions & 10 deletions

File tree

Cargo.lock

Lines changed: 145 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sim-cli/src/parsing.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ use simln_lib::sim_node::{
99
SimGraph, SimNode, SimulatedChannel,
1010
};
1111
use simln_lib::{
12-
cln, cln::ClnNode, eclair, eclair::EclairNode, lnd, lnd::LndNode, serializers,
13-
ActivityDefinition, Amount, Interval, LightningError, LightningNode, NodeId, NodeInfo,
14-
Simulation, SimulationCfg, WriteResults,
12+
cln, cln::ClnNode, eclair, eclair::EclairNode, ldk, ldk::LdkNode, lnd, lnd::LndNode,
13+
serializers, ActivityDefinition, Amount, Interval, LightningError, LightningNode, NodeId,
14+
NodeInfo, Simulation, SimulationCfg, WriteResults,
1515
};
1616
use simln_lib::{ShortChannelID, SimulationError};
1717
use std::collections::HashMap;
@@ -160,6 +160,7 @@ pub enum NodeConnection {
160160
Lnd(lnd::LndConnection),
161161
Cln(cln::ClnConnection),
162162
Eclair(eclair::EclairConnection),
163+
Ldk(ldk::LdkConnection),
163164
}
164165

165166
/// Data structure that is used to parse information from the simulation file. It is used to
@@ -396,6 +397,7 @@ async fn get_clients(
396397
NodeConnection::Lnd(c) => Arc::new(Mutex::new(LndNode::new(c).await?)),
397398
NodeConnection::Cln(c) => Arc::new(Mutex::new(ClnNode::new(c).await?)),
398399
NodeConnection::Eclair(c) => Arc::new(Mutex::new(EclairNode::new(c).await?)),
400+
NodeConnection::Ldk(c) => Arc::new(Mutex::new(LdkNode::new(c).await?)),
399401
};
400402

401403
let node_info = node.lock().await.get_info().clone();

simln-lib/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ rand_distr = "0.4.3"
3333
rand_chacha = "0.3.1"
3434
reqwest = { version = "0.12", features = ["json", "multipart"] }
3535
tokio-util = { version = "0.7.13", features = ["rt"] }
36+
ldk-server-client = { git = "https://github.com/lightningdevkit/ldk-server", rev = "570ed527535da0ec1dae431fac3ce46e5e6a468f" }
3637

3738
[dev-dependencies]
3839
ntest = "0.9.0"

0 commit comments

Comments
 (0)