pub struct DiscoveryConfig {
pub pkarr_url: Option<String>,
pub dns_origin: Option<String>,
pub peers: Option<HashMap<String, DiscoveryPeer>>,
}Expand description
Operator-configurable address-discovery providers (#818 scope 1).
Two mechanisms, selectable by which keys are present and combinable:
- Custom pkarr + DNS (
Self::pkarr_url+Self::dns_origin) — publish this node’s signed address record to an operator-run pkarr relay and resolve peers via an operator-run DNS server. Closest to n0’s model; supports dynamic addresses. - Static peer map (
Self::peers) — aMemoryLookupaddress book supplied directly in config. Fully offline/isolated; addresses must be known ahead of time.
Fields§
§pkarr_url: Option<String>pkarr relay URL this node PUBLISHES its signed address record to. Must
be paired with Self::dns_origin (a resolver for the same namespace):
publishing to a relay nothing resolves from is rejected at config
validation. Parse-checked as a URL at resolution.
dns_origin: Option<String>DNS origin domain this node RESOLVES peer addresses from (TXT queries
_iroh.<z32-id>.<dns_origin>). Valid on its own (a resolve-only node
that does not publish). Checked non-empty at resolution.
peers: Option<HashMap<String, DiscoveryPeer>>Static peer address book seeded into a MemoryLookup, keyed by peer
NodeId (the canonical 64-char lowercase-hex form iroh emits; validated
with the same parser the node uses at bring-up). Composes alongside the
pkarr/DNS leg when both are set.
Trait Implementations§
Source§impl Debug for DiscoveryConfig
impl Debug for DiscoveryConfig
Source§impl Default for DiscoveryConfig
impl Default for DiscoveryConfig
Source§impl<'de> Deserialize<'de> for DiscoveryConfig
impl<'de> Deserialize<'de> for DiscoveryConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DiscoveryConfig
impl RefUnwindSafe for DiscoveryConfig
impl Send for DiscoveryConfig
impl Sync for DiscoveryConfig
impl Unpin for DiscoveryConfig
impl UnsafeUnpin for DiscoveryConfig
impl UnwindSafe for DiscoveryConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more