Skip to content

Commit bd668f6

Browse files
committed
Add config options for HRN-related settings
1 parent 3e30347 commit bd668f6

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

bindings/ldk_node.udl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dictionary Config {
1313
u64 probing_liquidity_limit_multiplier;
1414
AnchorChannelsConfig? anchor_channels_config;
1515
RouteParametersConfig? route_parameters;
16+
HumanReadableNamesConfig? hrn_config;
1617
};
1718

1819
dictionary AnchorChannelsConfig {
@@ -477,6 +478,12 @@ dictionary RouteParametersConfig {
477478
u8 max_channel_saturation_power_of_half;
478479
};
479480

481+
dictionary HumanReadableNamesConfig {
482+
sequence<PublicKey> default_dns_resolvers;
483+
boolean is_hrn_resolver;
484+
string dns_server_address;
485+
};
486+
480487
dictionary CustomTlvRecord {
481488
u64 type_num;
482489
sequence<u8> value;

src/config.rs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ pub(crate) const EXTERNAL_PATHFINDING_SCORES_SYNC_TIMEOUT_SECS: u64 = 5;
119119
/// | `probing_liquidity_limit_multiplier` | 3 |
120120
/// | `log_level` | Debug |
121121
/// | `anchor_channels_config` | Some(..) |
122-
/// | `route_parameters` | None |
122+
/// | `route_parameters` | None |
123+
/// | `hrn_config` | None |
123124
///
124125
/// See [`AnchorChannelsConfig`] and [`RouteParametersConfig`] for more information regarding their
125126
/// respective default values.
@@ -184,6 +185,10 @@ pub struct Config {
184185
/// **Note:** If unset, default parameters will be used, and you will be able to override the
185186
/// parameters on a per-payment basis in the corresponding method calls.
186187
pub route_parameters: Option<RouteParametersConfig>,
188+
/// Configuration options for Human-Readable Names ([BIP 353]).
189+
///
190+
/// [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
191+
pub hrn_config: Option<HumanReadableNamesConfig>,
187192
}
188193

189194
impl Default for Config {
@@ -198,10 +203,28 @@ impl Default for Config {
198203
anchor_channels_config: Some(AnchorChannelsConfig::default()),
199204
route_parameters: None,
200205
node_alias: None,
206+
hrn_config: None,
201207
}
202208
}
203209
}
204210

211+
/// Configuration options for Human-Readable Names ([BIP 353]).
212+
///
213+
/// [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
214+
#[derive(Debug, Clone)]
215+
pub struct HumanReadableNamesConfig {
216+
/// The Default DNS resolvers to be used for resolving Human-Readable Names.
217+
///
218+
/// If not empty, the values set will be used as DNS resolvers when sending to HRNs.
219+
///
220+
/// **Note:** If empty, DNS resolvers would be selected from the network graph.
221+
pub default_dns_resolvers: Vec<PublicKey>,
222+
/// This allows us to use our node as a DNS resolver for 3rd party HRN resolutions.
223+
pub is_hrn_resolver: bool,
224+
/// The DNS Server which will be used for resolving HRNs.
225+
pub dns_server_address: String,
226+
}
227+
205228
/// Configuration options pertaining to 'Anchor' channels, i.e., channels for which the
206229
/// `option_anchors_zero_fee_htlc_tx` channel type is negotiated.
207230
///

src/ffi/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub use vss_client::headers::{VssHeaderProvider, VssHeaderProviderError};
4545
use crate::builder::sanitize_alias;
4646
pub use crate::config::{
4747
default_config, AnchorChannelsConfig, BackgroundSyncConfig, ElectrumSyncConfig,
48-
EsploraSyncConfig, MaxDustHTLCExposure,
48+
EsploraSyncConfig, HumanReadableNamesConfig, MaxDustHTLCExposure,
4949
};
5050
use crate::error::Error;
5151
pub use crate::graph::{ChannelInfo, ChannelUpdateInfo, NodeAnnouncementInfo, NodeInfo};

tests/integration_tests_rust.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// accordance with one or both of these licenses.
77

88
mod common;
9-
use lightning::util::persist::KVStoreSync;
109
use std::collections::HashSet;
1110
use std::str::FromStr;
1211
use std::sync::Arc;

0 commit comments

Comments
 (0)