Skip to content

Commit 8337320

Browse files
committed
rename LdkNode to LdkServer
1 parent d0a385e commit 8337320

4 files changed

Lines changed: 17 additions & 14 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ lightning network development. It may be useful to you if you are:
1616
* LND ✅
1717
* CLN ✅
1818
* Eclair ✅️
19-
* LDK-server
19+
* LDK-Server
2020

2121
See our [tracking issue](https://github.com/bitcoin-dev-project/sim-ln/issues/26)
2222
for updates on implementation support (contributions welcome!).
@@ -36,7 +36,7 @@ of the simulator uses keysend to execute payments, which must be enabled as foll
3636
* LND: `--accept-keysend`
3737
* CLN: enabled by default
3838
* Eclair: `-Declair.features.keysend=optional` (or `--features.keysend=optional` if you're using Polar)
39-
* LDK-server: enabled by default via `spontaneous_send`
39+
* LDK-Server: enabled by default via `spontaneous_send`
4040

4141
NOTE: for CLN `keysend` to work with eclair, you need to add additional config to eclair:
4242
```
@@ -99,7 +99,7 @@ The required access details will depend on the node implementation.
9999
"api_password": <password_to_authorize>
100100
}
101101
```
102-
* LDK-server:
102+
* LDK-Server:
103103
```
104104
{
105105
"address": <ip:port or domain:port>,

sim-cli/src/parsing.rs

Lines changed: 5 additions & 5 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, ldk, ldk::LdkNode, lnd, lnd::LndNode,
13-
serializers, ActivityDefinition, Amount, Interval, LightningError, LightningNode, NodeId,
14-
NodeInfo, Simulation, SimulationCfg, WriteResults,
12+
cln, cln::ClnNode, eclair, eclair::EclairNode, ldk_server, ldk_server::LdkServer, lnd,
13+
lnd::LndNode, serializers, ActivityDefinition, Amount, Interval, LightningError, LightningNode,
14+
NodeId, NodeInfo, Simulation, SimulationCfg, WriteResults,
1515
};
1616
use simln_lib::{ShortChannelID, SimulationError};
1717
use std::collections::HashMap;
@@ -160,7 +160,7 @@ pub enum NodeConnection {
160160
Lnd(lnd::LndConnection),
161161
Cln(cln::ClnConnection),
162162
Eclair(eclair::EclairConnection),
163-
Ldk(ldk::LdkConnection),
163+
Ldk(ldk_server::LdkServerConnection),
164164
}
165165

166166
/// Data structure that is used to parse information from the simulation file. It is used to
@@ -397,7 +397,7 @@ async fn get_clients(
397397
NodeConnection::Lnd(c) => Arc::new(Mutex::new(LndNode::new(c).await?)),
398398
NodeConnection::Cln(c) => Arc::new(Mutex::new(ClnNode::new(c).await?)),
399399
NodeConnection::Eclair(c) => Arc::new(Mutex::new(EclairNode::new(c).await?)),
400-
NodeConnection::Ldk(c) => Arc::new(Mutex::new(LdkNode::new(c).await?)),
400+
NodeConnection::Ldk(c) => Arc::new(Mutex::new(LdkServer::new(c).await?)),
401401
};
402402

403403
let node_info = node.lock().await.get_info().clone();
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ use crate::{
2222
serializers, Graph, LightningError, LightningNode, NodeInfo, PaymentOutcome, PaymentResult,
2323
};
2424

25-
pub struct LdkNode {
25+
pub struct LdkServer {
2626
client: LdkServerClient,
2727
info: NodeInfo,
2828
network: Network,
2929
}
3030

3131
#[derive(Serialize, Deserialize, Debug, Clone)]
32-
pub struct LdkConnection {
32+
pub struct LdkServerConnection {
3333
pub address: String,
3434
pub api_key: String,
3535
#[serde(deserialize_with = "serializers::deserialize_path")]
3636
pub cert: String,
3737
}
3838

39-
impl LdkNode {
40-
pub async fn new(connection: LdkConnection) -> Result<Self, LightningError> {
39+
impl LdkServer {
40+
pub async fn new(connection: LdkServerConnection) -> Result<Self, LightningError> {
4141
let cert_pem = std::fs::read(&connection.cert).map_err(|err| {
4242
LightningError::ConnectionError(format!("Cannot load TLS cert: {err}"))
4343
})?;
@@ -81,7 +81,7 @@ impl LdkNode {
8181
}
8282

8383
#[async_trait]
84-
impl LightningNode for LdkNode {
84+
impl LightningNode for LdkServer {
8585
fn get_info(&self) -> &NodeInfo {
8686
&self.info
8787
}
@@ -253,6 +253,9 @@ fn network_from_proto(value: i32) -> Result<Network, LightningError> {
253253
match value {
254254
0 => Ok(Network::Bitcoin),
255255
1 => Ok(Network::Testnet),
256+
2 => Err(LightningError::GetInfoError(format!(
257+
"testnet4 network is not supported"
258+
))),
256259
3 => Ok(Network::Signet),
257260
4 => Ok(Network::Regtest),
258261
other => Err(LightningError::GetInfoError(format!(

simln-lib/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub mod clock;
3636
mod defined_activity;
3737
pub mod eclair;
3838
pub mod latency_interceptor;
39-
pub mod ldk;
39+
pub mod ldk_server;
4040
pub mod lnd;
4141
mod random_activity;
4242
pub mod serializers;

0 commit comments

Comments
 (0)