pub struct PkarrPublisher { /* private fields */ }
Expand description
Publisher of node discovery information to a pkarr relay.
This publisher uses HTTP to publish node discovery information to a pkarr relay server, see the module docs for details.
This implements the Discovery
trait to be used as a node discovery service. Note
that it only publishes node discovery information, for the corresponding resolver use
the PkarrResolver
together with ConcurrentDiscovery
.
This publisher will only publish the RelayUrl
if the AddrInfo
contains a
RelayUrl
. If the AddrInfo
does not contain a RelayUrl
the direct
addresses are published instead.
Implementations§
Source§impl PkarrPublisher
impl PkarrPublisher
Sourcepub fn new(secret_key: SecretKey, pkarr_relay: Url) -> Self
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub fn new(secret_key: SecretKey, pkarr_relay: Url) -> Self
Creates a new publisher for the SecretKey
.
This publisher will be able to publish pkarr records for SecretKey
. It will
use DEFAULT_PKARR_TTL
as the time-to-live value for the published packets. Will
republish discovery information every DEFAULT_REPUBLISH_INTERVAL
, even if the
information is unchanged.
Sourcepub fn with_options(
secret_key: SecretKey,
pkarr_relay: Url,
ttl: u32,
republish_interval: Duration,
) -> Self
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub fn with_options( secret_key: SecretKey, pkarr_relay: Url, ttl: u32, republish_interval: Duration, ) -> Self
Creates a new PkarrPublisher
with a custom TTL and republish intervals.
This allows creating the publisher with custom time-to-live values of the
pkarr::SignedPacket
s and well as a custom republish interval.
Sourcepub fn n0_dns(secret_key: SecretKey) -> Self
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub fn n0_dns(secret_key: SecretKey) -> Self
Creates a pkarr publisher which uses the number 0 pkarr relay server.
This uses the pkarr relay server operated by number 0, at
N0_DNS_PKARR_RELAY_PROD
.
When running with the environment variable
IROH_FORCE_STAGING_RELAYS
set to any non empty value N0_DNS_PKARR_RELAY_STAGING
server is used instead.
Sourcepub fn update_addr_info(&self, info: &AddrInfo)
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub fn update_addr_info(&self, info: &AddrInfo)
Publishes AddrInfo
about this node to a pkarr relay.
This is a nonblocking function, the actual update is performed in the background.
Trait Implementations§
Source§impl Clone for PkarrPublisher
impl Clone for PkarrPublisher
Source§fn clone(&self) -> PkarrPublisher
fn clone(&self) -> PkarrPublisher
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more