Skip to main content

Crate reth_discv5

Crate reth_discv5 

Source
Expand description

Wrapper around [discv5::Discv5].

Re-exports§

pub use config::BootNode;
pub use config::Config;
pub use config::ConfigBuilder;
pub use config::DEFAULT_COUNT_BOOTSTRAP_LOOKUPS;
pub use config::DEFAULT_DISCOVERY_V5_ADDR;
pub use config::DEFAULT_DISCOVERY_V5_ADDR_IPV6;
pub use config::DEFAULT_DISCOVERY_V5_LISTEN_CONFIG;
pub use config::DEFAULT_DISCOVERY_V5_PORT;
pub use config::DEFAULT_SECONDS_BOOTSTRAP_LOOKUP_INTERVAL;
pub use config::DEFAULT_SECONDS_LOOKUP_INTERVAL;
pub use enr::enr_to_discv4_id;
pub use error::Error;
pub use filter::FilterOutcome;
pub use filter::MustNotIncludeKeys;
pub use network_stack_id::NetworkStackId;
pub use self;
pub use libp2p_identity;

Modules§

config
Wrapper around [discv5::Config].
enr
Interface between node identification on protocol version 5 and 4. Specifically, between types enr::NodeId and PeerId.
error
Errors interfacing with [discv5::Discv5].
filter
Predicates to constrain peer lookups.
metrics
Tracks peer discovery for Discv5.
network_stack_id
Keys of ENR ForkId kv-pair. Identifies which network stack a node belongs to.

Structs§

DiscoveredPeer
Result of successfully processing a peer discovered by [discv5::Discv5].
Discv5
Transparent wrapper around [discv5::Discv5].
Enr
The ENR, allowing for arbitrary signing algorithms.
NodeId
The NodeId of an ENR (a 32 byte identifier).

Enums§

CombinedKey
A standard implementation of the EnrKey trait used to sign and modify ENR records. The variants here represent the currently supported in-built signing schemes.
IpMode
Sets the socket type to be established and also determines the type of ENRs that we will store in our routing table. We store ENR’s that have a get_contractable_addr() based on the IpMode set.

Constants§

DEFAULT_MIN_TARGET_KBUCKET_INDEX
Default lowest kbucket index to attempt filling, in periodic look up query to populate kbuckets.
MAX_KBUCKET_INDEX
Max kbucket index is 255.

Traits§

EnrKey
The trait required for a key to sign and modify an ENR record.

Functions§

bootstrap
Bootstraps underlying [discv5::Discv5] node with configured peers.
build_local_enr
Builds the local ENR with the supplied key.
get_lookup_target
Gets the next lookup target, based on which bucket is currently being targeted.
lookup
Runs a [discv5::Discv5] lookup query.
spawn_populate_kbuckets_bg
Backgrounds regular look up queries, in order to keep kbuckets populated.