[−][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:
-
Makes itself discoverable
-
Retrieves its external addresses (including peer id) or the ones of its sentry nodes.
-
Signs the above.
-
Puts the signature and the addresses on the libp2p Kademlia DHT.
-
-
Discovers other authorities
-
Retrieves the current set of authorities.
-
Starts DHT queries for the ids of the authorities.
-
Validates the signatures of the retrieved key value pairs.
-
Adds the retrieved external addresses as priority nodes to the peerset.
-
When run as a sentry node, the authority discovery module does not publish any addresses to the DHT but still discovers validators and sentry nodes of validators, i.e. only step 2 (Discovers other authorities) is executed.
Structs
AuthorityDiscovery | An |
Enums
Role | Role an authority discovery module can run as. |
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. |