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
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
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
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)
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 moreSource§impl Debug for PkarrPublisher
impl Debug for PkarrPublisher
Auto Trait Implementations§
impl Freeze for PkarrPublisher
impl !RefUnwindSafe for PkarrPublisher
impl Send for PkarrPublisher
impl Sync for PkarrPublisher
impl Unpin for PkarrPublisher
impl !UnwindSafe for PkarrPublisher
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)