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 discv5;

Modules§

config
Wrapper around [discv5::Config].
enr
Interface between node identification on protocol version 5 and 4. Specifically, between types [discv5::enr::NodeId] and [PeerId].
error
Errors interfacing with [discv5::Discv5].
filter
Predicates to constraint 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].

Enums§

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.

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.