File tree Expand file tree Collapse file tree 5 files changed +27
-16
lines changed
ldk-node-android/lib/src/androidTest/kotlin/org/lightningdevkit/ldknode
ldk-node-jvm/lib/src/test/kotlin/org/lightningdevkit/ldknode Expand file tree Collapse file tree 5 files changed +27
-16
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,13 @@ class AndroidLibTest {
24
24
val listenAddress1 = " 127.0.0.1:2323"
25
25
val listenAddress2 = " 127.0.0.1:2324"
26
26
27
- val config1 = Config ()
27
+ val config1 = defaultConfig ()
28
28
config1.storageDirPath = tmpDir1
29
29
config1.listeningAddresses = listOf (listenAddress1)
30
30
config1.network = Network .REGTEST
31
31
config1.logLevel = LogLevel .TRACE
32
32
33
- val config2 = Config ()
33
+ val config2 = defaultConfig ()
34
34
config2.storageDirPath = tmpDir2
35
35
config2.listeningAddresses = listOf (listenAddress2)
36
36
config2.network = Network .REGTEST
Original file line number Diff line number Diff line change @@ -114,15 +114,15 @@ class LibraryTest {
114
114
val listenAddress1 = " 127.0.0.1:2323"
115
115
val listenAddress2 = " 127.0.0.1:2324"
116
116
117
- val config1 = Config ()
117
+ val config1 = defaultConfig ()
118
118
config1.storageDirPath = tmpDir1
119
119
config1.listeningAddresses = listOf (listenAddress1)
120
120
config1.network = Network .REGTEST
121
121
config1.logLevel = LogLevel .TRACE
122
122
123
123
println (" Config 1: $config1 " )
124
124
125
- val config2 = Config ()
125
+ val config2 = defaultConfig ()
126
126
config2.storageDirPath = tmpDir2
127
127
config2.listeningAddresses = listOf (listenAddress2)
128
128
config2.network = Network .REGTEST
Original file line number Diff line number Diff line change 1
1
namespace ldk_node {
2
2
Mnemonic generate_entropy_mnemonic();
3
+ Config default_config();
3
4
};
4
5
5
6
dictionary Config {
6
- string storage_dir_path = "/tmp/ldk_node/" ;
7
- string? log_dir_path = null ;
8
- Network network = "Bitcoin" ;
9
- sequence<SocketAddress>? listening_addresses = null ;
10
- u32 default_cltv_expiry_delta = 144 ;
11
- u64 onchain_wallet_sync_interval_secs = 80 ;
12
- u64 wallet_sync_interval_secs = 30 ;
13
- u64 fee_rate_cache_update_interval_secs = 600 ;
14
- sequence<PublicKey> trusted_peers_0conf = [] ;
15
- u64 probing_liquidity_limit_multiplier = 3 ;
16
- LogLevel log_level = "Debug" ;
7
+ string storage_dir_path;
8
+ string? log_dir_path;
9
+ Network network;
10
+ sequence<SocketAddress>? listening_addresses;
11
+ u32 default_cltv_expiry_delta;
12
+ u64 onchain_wallet_sync_interval_secs;
13
+ u64 wallet_sync_interval_secs;
14
+ u64 fee_rate_cache_update_interval_secs;
15
+ sequence<PublicKey> trusted_peers_0conf;
16
+ u64 probing_liquidity_limit_multiplier;
17
+ LogLevel log_level;
17
18
};
18
19
19
20
interface Builder {
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ def send_to_address(address, amount_sats):
81
81
82
82
83
83
def setup_node (tmp_dir , esplora_endpoint , listening_addresses ):
84
- config = Config ()
84
+ config = default_config ()
85
85
builder = Builder .from_config (config )
86
86
builder .set_storage_dir_path (tmp_dir )
87
87
builder .set_esplora_server (esplora_endpoint )
Original file line number Diff line number Diff line change @@ -278,6 +278,16 @@ impl Default for Config {
278
278
}
279
279
}
280
280
281
+ /// Returns a [`Config`] object populated with default values.
282
+ ///
283
+ /// See the documentation of [`Config`] for more information on the used defaults.
284
+ ///
285
+ /// This is mostly meant for use in bindings, in Rust this is synonymous with
286
+ /// [`Config::default()`].
287
+ pub fn default_config ( ) -> Config {
288
+ Config :: default ( )
289
+ }
290
+
281
291
/// The main interface object of LDK Node, wrapping the necessary LDK and BDK functionalities.
282
292
///
283
293
/// Needs to be initialized and instantiated through [`Builder::build`].
You can’t perform that action at this time.
0 commit comments