Skip to content

Commit b8e3d7a

Browse files
committed
Clarify Builder/Config docs
We improve the docs a bit, highlight the requirements for node aliases, and that we'll only ever allow announcing channels if they are properly set.
1 parent 11f9a89 commit b8e3d7a

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/builder.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,10 @@ impl NodeBuilder {
307307
Ok(self)
308308
}
309309

310-
/// Sets the alias the [`Node`] will use in its announcement.
310+
/// Sets the node alias that will be used when broadcasting announcements to the gossip
311+
/// network.
311312
///
312-
/// The provided alias must be a valid UTF-8 string.
313+
/// The provided alias must be a valid UTF-8 string and no longer than 32 bytes in total.
313314
pub fn set_node_alias(&mut self, node_alias: String) -> Result<&mut Self, BuildError> {
314315
let node_alias = sanitize_alias(&node_alias)?;
315316

@@ -515,7 +516,10 @@ impl ArcedNodeBuilder {
515516
self.inner.write().unwrap().set_listening_addresses(listening_addresses).map(|_| ())
516517
}
517518

518-
/// Sets the node alias.
519+
/// Sets the node alias that will be used when broadcasting announcements to the gossip
520+
/// network.
521+
///
522+
/// The provided alias must be a valid UTF-8 string and no longer than 32 bytes in total.
519523
pub fn set_node_alias(&self, node_alias: String) -> Result<(), BuildError> {
520524
self.inner.write().unwrap().set_node_alias(node_alias).map(|_| ())
521525
}

src/config.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,14 @@ pub struct Config {
113113
pub network: Network,
114114
/// The addresses on which the node will listen for incoming connections.
115115
///
116-
/// **Note**: Node announcements will only be broadcast if the `node_alias` and the
116+
/// **Note**: We will only allow opening and accepting public channels if the `node_alias` and the
117117
/// `listening_addresses` are set.
118118
pub listening_addresses: Option<Vec<SocketAddress>>,
119-
/// The node alias to be used in announcements.
119+
/// The node alias that will be used when broadcasting announcements to the gossip network.
120120
///
121-
/// **Note**: Node announcements will only be broadcast if the `node_alias` and the
121+
/// The provided alias must be a valid UTF-8 string and no longer than 32 bytes in total.
122+
///
123+
/// **Note**: We will only allow opening and accepting public channels if the `node_alias` and the
122124
/// `listening_addresses` are set.
123125
pub node_alias: Option<NodeAlias>,
124126
/// The time in-between background sync attempts of the onchain wallet, in seconds.

0 commit comments

Comments
 (0)