[][src]Crate sc_authority_discovery

Substrate authority discovery.

This crate enables Substrate authorities to directly connect to other authorities. AuthorityDiscovery implements the Future trait. By polling AuthorityDiscovery an authority:

  1. Makes itself discoverable

    1. Retrieves its external addresses.

    2. Adds its network peer id to the addresses.

    3. Signs the above.

    4. Puts the signature and the addresses on the libp2p Kademlia DHT.

  2. Discovers other authorities

    1. Retrieves the current set of authorities.

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

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

    4. Adds the retrieved external addresses as priority nodes to the peerset.

Structs

AuthorityDiscovery

An AuthorityDiscovery makes a given authority discoverable and discovers other authorities.

Traits

NetworkProvider

NetworkProvider provides AuthorityDiscovery with all necessary hooks into the underlying Substrate networking. Using this trait abstraction instead of NetworkService directly is necessary to unit test AuthorityDiscovery.