Skip to content

Commit bbc3ffc

Browse files
authored
Merge pull request #124 from tnull/2023-06-update-sync-constants
Update config defaults and expose them in bindings
2 parents 821b06a + 4f8703d commit bbc3ffc

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

bindings/ldk_node.udl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ namespace ldk_node {
33
};
44

55
dictionary Config {
6-
string storage_dir_path;
7-
Network network;
8-
NetAddress? listening_address;
9-
u32 default_cltv_expiry_delta;
10-
u64 onchain_wallet_sync_interval_secs;
11-
u64 wallet_sync_interval_secs;
12-
u64 fee_rate_cache_update_interval_secs;
13-
LogLevel log_level;
14-
sequence<PublicKey> trusted_peers_0conf;
6+
string storage_dir_path = "/tmp/ldk_node/";
7+
Network network = "Bitcoin";
8+
NetAddress? listening_address = null;
9+
u32 default_cltv_expiry_delta = 144;
10+
u64 onchain_wallet_sync_interval_secs = 80;
11+
u64 wallet_sync_interval_secs = 30;
12+
u64 fee_rate_cache_update_interval_secs = 600;
13+
LogLevel log_level = "Debug";
14+
sequence<PublicKey> trusted_peers_0conf = [];
1515
};
1616

1717
interface Builder {

src/lib.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,18 @@ uniffi::include_scaffolding!("ldk_node");
163163
// Config defaults
164164
const DEFAULT_STORAGE_DIR_PATH: &str = "/tmp/ldk_node/";
165165
const DEFAULT_NETWORK: Network = Network::Bitcoin;
166-
const DEFAULT_LISTENING_ADDR: &str = "0.0.0.0:9735";
167166
const DEFAULT_CLTV_EXPIRY_DELTA: u32 = 144;
168-
const DEFAULT_BDK_WALLET_SYNC_INTERVAL_SECS: u64 = 60;
169-
const DEFAULT_LDK_WALLET_SYNC_INTERVAL_SECS: u64 = 20;
167+
const DEFAULT_BDK_WALLET_SYNC_INTERVAL_SECS: u64 = 80;
168+
const DEFAULT_LDK_WALLET_SYNC_INTERVAL_SECS: u64 = 30;
170169
const DEFAULT_FEE_RATE_CACHE_UPDATE_INTERVAL_SECS: u64 = 60 * 10;
171170
const DEFAULT_LOG_LEVEL: LogLevel = LogLevel::Debug;
172171

173172
// The 'stop gap' parameter used by BDK's wallet sync. This seems to configure the threshold
174-
// number of blocks after which BDK stops looking for scripts belonging to the wallet.
173+
// number of derivation indexes after which BDK stops looking for new scripts belonging to the wallet.
175174
const BDK_CLIENT_STOP_GAP: usize = 20;
176175

177176
// The number of concurrent requests made against the API provider.
178-
const BDK_CLIENT_CONCURRENCY: u8 = 8;
177+
const BDK_CLIENT_CONCURRENCY: u8 = 4;
179178

180179
// The default Esplora server we're using.
181180
const DEFAULT_ESPLORA_SERVER_URL: &str = "https://blockstream.info/api";
@@ -206,14 +205,14 @@ const WALLET_KEYS_SEED_LEN: usize = 64;
206205
/// | Parameter | Value |
207206
/// |----------------------------------------|------------------|
208207
/// | `storage_dir_path` | /tmp/ldk_node/ |
209-
/// | `network` | `Bitcoin |
210-
/// | `listening_address` | 0.0.0.0:9735 |
208+
/// | `network` | Bitcoin |
209+
/// | `listening_address` | None |
211210
/// | `default_cltv_expiry_delta` | 144 |
212-
/// | `onchain_wallet_sync_interval_secs` | 60 |
213-
/// | `wallet_sync_interval_secs` | 20 |
211+
/// | `onchain_wallet_sync_interval_secs` | 80 |
212+
/// | `wallet_sync_interval_secs` | 30 |
214213
/// | `fee_rate_cache_update_interval_secs` | 600 |
215214
/// | `trusted_peers_0conf` | [] |
216-
/// | `log_level` | `Debug` |
215+
/// | `log_level` | Debug |
217216
///
218217
pub struct Config {
219218
/// The path where the underlying LDK and BDK persist their data.
@@ -253,7 +252,7 @@ impl Default for Config {
253252
Self {
254253
storage_dir_path: DEFAULT_STORAGE_DIR_PATH.to_string(),
255254
network: DEFAULT_NETWORK,
256-
listening_address: Some(DEFAULT_LISTENING_ADDR.parse().unwrap()),
255+
listening_address: None,
257256
default_cltv_expiry_delta: DEFAULT_CLTV_EXPIRY_DELTA,
258257
onchain_wallet_sync_interval_secs: DEFAULT_BDK_WALLET_SYNC_INTERVAL_SECS,
259258
wallet_sync_interval_secs: DEFAULT_LDK_WALLET_SYNC_INTERVAL_SECS,

0 commit comments

Comments
 (0)