pub fn build_or_load_enr<T: EthSpec>(
    local_key: Keypair,
    config: &NetworkConfig,
    enr_fork_id: EnrForkId,
    log: &slog::Logger,
) -> Result<Enr, String> {
    // Build the local ENR.
    // Note: Discovery should update the ENR record's IP to the external IP as seen by the
    // majority of our peers, if the CLI doesn't expressly forbid it.
    let enr_key = CombinedKey::from_libp2p(&local_key)?;
    let mut local_enr = build_enr::<T>(&enr_key, config, enr_fork_id)?;

    use_or_load_enr(&enr_key, &mut local_enr, config, log)?;
    Ok(local_enr)
}
/// Loads an ENR from file if it exists and matches the current NodeId and sequence number. If none
/// exists, generates a new one.
///
/// If an ENR exists, with the same NodeId, this function checks to see if the loaded ENR from
/// disk is suitable to use, otherwise we increment our newly generated ENR's sequence number.
Loads an ENR from file if it exists and matches the current NodeId and sequence number. If none
exists, generates a new one.

If an ENR exists, with the same NodeId, this function checks to see if the loaded ENR from
disk is suitable to use, otherwise we increment our newly generated ENR's sequence number.
Loads an ENR from file if it exists and matches the current NodeId and sequence number . If none exists generates a new one . If an ENR exists with the same NodeId this function checks to see if the loaded ENR from disk is suitable to use otherwise we increment our newly generated ENR ' s sequence number .
pub fn build_or_load_enr<T: EthSpec>(
    local_key: Keypair,
    config: &NetworkConfig,
    enr_fork_id: EnrForkId,
    log: &slog::Logger,
) -> Result<Enr, String> {
    // Build the local ENR.
    // Note: Discovery should update the ENR record's IP to the external IP as seen by the
    // majority of our peers, if the CLI doesn't expressly forbid it.
    let enr_key = CombinedKey::from_libp2p(&local_key)?;
    let mut local_enr = build_enr::<T>(&enr_key, config, enr_fork_id)?;
    use_or_load_enr(&enr_key, &mut local_enr, config, log)?;
    Ok(local_enr)
}
pub fn build_or_load_enr < T : EthSpec > ( local_key : Keypair , config : & NetworkConfig , enr_fork_id : EnrForkId , log : & slog :: Logger , ) -> Result < Enr , String > { // Build the local ENR. // Note: Discovery should update the ENR record's IP to the external IP as seen by the // majority of our peers, if the CLI doesn't expressly forbid it. let enr_key = CombinedKey :: from_libp2p ( & local_key ) ? ; let mut local_enr = build_enr :: < T > ( & enr_key , config , enr_fork_id ) ? ; use_or_load_enr ( & enr_key , & mut local_enr , config , log ) ? ; Ok ( local_enr ) }
Loads an ENR from file if it exists and matches the current NodeId and sequence number.
Loads an ENR from file if it exists and matches the current NodeId and sequence number .
local_key
Keypair
config
&NetworkConfig
enr_fork_id
EnrForkId
log
&slog::Logger