pub fn build_enr<T: EthSpec>(
    enr_key: &CombinedKey,
    config: &NetworkConfig,
    enr_fork_id: EnrForkId,
) -> Result<Enr, String> {
    let mut builder = create_enr_builder_from_config(config, true);

    // set the `eth2` field on our ENR
    builder.add_value(ETH2_ENR_KEY, &enr_fork_id.as_ssz_bytes());

    // set the "attnets" field on our ENR
    let bitfield = BitVector::<T::SubnetBitfieldLength>::new();

    builder.add_value(BITFIELD_ENR_KEY, &bitfield.as_ssz_bytes());

    builder
        .build(enr_key)
        .map_err(|e| format!("Could not build Local ENR: {:?}", e))
}
/// Builds a lighthouse ENR given a `NetworkConfig`.
Builds a lighthouse ENR given a `NetworkConfig`.
Builds a lighthouse ENR given a ` NetworkConfig ` .
pub fn build_enr<T: EthSpec>(
    enr_key: &CombinedKey,
    config: &NetworkConfig,
    enr_fork_id: EnrForkId,
) -> Result<Enr, String> {
    let mut builder = create_enr_builder_from_config(config, true);
    // set the `eth2` field on our ENR
    builder.add_value(ETH2_ENR_KEY, &enr_fork_id.as_ssz_bytes());
    // set the "attnets" field on our ENR
    let bitfield = BitVector::<T::SubnetBitfieldLength>::new();
    builder.add_value(BITFIELD_ENR_KEY, &bitfield.as_ssz_bytes());
    builder
        .build(enr_key)
        .map_err(|e| format!("Could not build Local ENR: {:?}", e))
}
pub fn build_enr < T : EthSpec > ( enr_key : & CombinedKey , config : & NetworkConfig , enr_fork_id : EnrForkId , ) -> Result < Enr , String > { let mut builder = create_enr_builder_from_config ( config , true ) ; // set the `eth2` field on our ENR builder . add_value ( ETH2_ENR_KEY , & enr_fork_id . as_ssz_bytes ( ) ) ; // set the "attnets" field on our ENR let bitfield = BitVector :: < T :: SubnetBitfieldLength > :: new ( ) ; builder . add_value ( BITFIELD_ENR_KEY , & bitfield . as_ssz_bytes ( ) ) ; builder . build ( enr_key ) . map_err ( | e | format ! ( " " e ) ) }
Builds a lighthouse ENR given a `NetworkConfig`.
Builds a lighthouse ENR given a ` NetworkConfig ` .
enr_key
&CombinedKey
config
&NetworkConfig
enr_fork_id
EnrForkId