Struct sc_authority_discovery::Worker[][src]

pub struct Worker<Client, Network, Block, DhtEventStream> { /* fields omitted */ }

An authority discovery Worker can publish the local node's addresses as well as discover those of other nodes via a Kademlia DHT.

When constructed with Role::PublishAndDiscover a Worker will

  1. Retrieve its external addresses (including peer id).

  2. Get the list of keys owned by the local node participating in the current authority set.

  3. Sign the addresses with the keys.

  4. Put addresses and signature as a record with the authority id as a key on a Kademlia DHT.

When constructed with either Role::PublishAndDiscover or [Role::Publish] a Worker will

  1. Retrieve the current and next set of authorities.

  2. Start DHT queries for the ids of the authorities.

  3. Validate the signatures of the retrieved key value pairs.

  4. Add the retrieved external addresses as priority nodes to the network peerset.

  5. Allow querying of the collected addresses via the crate::Service.

Implementations

impl<Client, Network, Block, DhtEventStream> Worker<Client, Network, Block, DhtEventStream> where
    Block: BlockT + Unpin + 'static,
    Network: NetworkProvider,
    Client: ProvideRuntimeApi<Block> + Send + Sync + 'static + HeaderBackend<Block>,
    <Client as ProvideRuntimeApi<Block>>::Api: AuthorityDiscoveryApi<Block, Error = Error>,
    DhtEventStream: Stream<Item = DhtEvent> + Unpin
[src]

pub async fn run(self)[src]

Start the worker

Auto Trait Implementations

impl<Client, Network, Block, DhtEventStream> !RefUnwindSafe for Worker<Client, Network, Block, DhtEventStream>[src]

impl<Client, Network, Block, DhtEventStream> Send for Worker<Client, Network, Block, DhtEventStream> where
    Block: Send,
    Client: Send + Sync,
    DhtEventStream: Send,
    Network: Send + Sync
[src]

impl<Client, Network, Block, DhtEventStream> Sync for Worker<Client, Network, Block, DhtEventStream> where
    Block: Sync,
    Client: Send + Sync,
    DhtEventStream: Sync,
    Network: Send + Sync
[src]

impl<Client, Network, Block, DhtEventStream> Unpin for Worker<Client, Network, Block, DhtEventStream> where
    Block: Unpin,
    DhtEventStream: Unpin
[src]

impl<Client, Network, Block, DhtEventStream> !UnwindSafe for Worker<Client, Network, Block, DhtEventStream>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CheckedConversion for T[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 
[src]

pub fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

pub fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    T: Bounded,
    S: TryInto<T>, 

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,