-
Notifications
You must be signed in to change notification settings - Fork 117
Add support for resolving BIP 353 Human-Readable Names #630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,7 +119,8 @@ pub(crate) const HRN_RESOLUTION_TIMEOUT_SECS: u64 = 5; | |
| /// | `probing_liquidity_limit_multiplier` | 3 | | ||
| /// | `log_level` | Debug | | ||
| /// | `anchor_channels_config` | Some(..) | | ||
| /// | `route_parameters` | None | | ||
| /// | `route_parameters` | None | | ||
| /// | `hrn_config` | Some(..) | | ||
| /// | ||
| /// See [`AnchorChannelsConfig`] and [`RouteParametersConfig`] for more information regarding their | ||
| /// respective default values. | ||
|
|
@@ -184,6 +185,10 @@ pub struct Config { | |
| /// **Note:** If unset, default parameters will be used, and you will be able to override the | ||
| /// parameters on a per-payment basis in the corresponding method calls. | ||
| pub route_parameters: Option<RouteParametersConfig>, | ||
| /// Configuration options for Human-Readable Names ([BIP 353]). | ||
| /// | ||
| /// [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki | ||
| pub hrn_config: Option<HumanReadableNamesConfig>, | ||
| } | ||
|
|
||
| impl Default for Config { | ||
|
|
@@ -198,6 +203,34 @@ impl Default for Config { | |
| anchor_channels_config: Some(AnchorChannelsConfig::default()), | ||
| route_parameters: None, | ||
| node_alias: None, | ||
| hrn_config: Some(HumanReadableNamesConfig::default()), | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /// Configuration options for Human-Readable Names ([BIP 353]). | ||
| /// | ||
| /// [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki | ||
| #[derive(Debug, Clone)] | ||
| pub struct HumanReadableNamesConfig { | ||
| /// The Default DNS resolvers to be used for resolving Human-Readable Names. | ||
| /// | ||
| /// If not empty, the values set will be used as DNS resolvers when sending to HRNs. | ||
| /// | ||
| /// **Note:** If empty, DNS resolvers would be selected from the network graph. | ||
| pub default_dns_resolvers: Vec<PublicKey>, | ||
| /// This allows us to use our node as a DNS resolver for 3rd party HRN resolutions. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: This is oddly formulated: if set this allows others to use our nodes for HRN resolutions, no? Probably also want to link to the bLIP here? |
||
| pub is_hrn_resolver: bool, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, maybe we should make this a |
||
| /// The DNS Server which will be used for resolving HRNs. | ||
| pub dns_server_address: String, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is confusing. How does this interact with
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes! that makes sense to me. |
||
| } | ||
|
|
||
| impl Default for HumanReadableNamesConfig { | ||
| fn default() -> Self { | ||
| HumanReadableNamesConfig { | ||
| default_dns_resolvers: Vec::new(), | ||
| is_hrn_resolver: false, | ||
| dns_server_address: String::new(), | ||
| } | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can just drop
Default, no?