Skip to main content

NetworkInfo

Trait NetworkInfo 

pub trait NetworkInfo: Send + Sync {
    // Required methods
    fn local_addr(&self) -> SocketAddr;
    fn network_status(
        &self,
    ) -> impl Future<Output = Result<NetworkStatus, NetworkError>> + Send;
    fn chain_id(&self) -> u64;
    fn cell_custody(&self) -> &CellCustody;
    fn is_syncing(&self) -> bool;
    fn is_initially_syncing(&self) -> bool;
}
Expand description

Provides general purpose information about the network.

Required Methods§

fn local_addr(&self) -> SocketAddr

Returns the SocketAddr that listens for incoming connections.

fn network_status( &self, ) -> impl Future<Output = Result<NetworkStatus, NetworkError>> + Send

Returns the current status of the network being ran by the local node.

fn chain_id(&self) -> u64

Returns the chain id

fn cell_custody(&self) -> &CellCustody

Returns shared blob cell custody state for EIP-8070 sparse blobpool sampling.

This is updated from non-null custodyColumns values received through engine_forkchoiceUpdatedV4 and should be treated as a lightweight sampling hint.

fn is_syncing(&self) -> bool

Returns true if the network is undergoing sync.

fn is_initially_syncing(&self) -> bool

Returns true when the node is undergoing the very first Pipeline sync.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl<'a, T> NetworkInfo for &'a T
where T: 'a + NetworkInfo + ?Sized, &'a T: Send + Sync,

§

fn local_addr(&self) -> SocketAddr

§

fn network_status( &self, ) -> impl Future<Output = Result<NetworkStatus, NetworkError>> + Send

§

fn chain_id(&self) -> u64

§

fn cell_custody(&self) -> &CellCustody

§

fn is_syncing(&self) -> bool

§

fn is_initially_syncing(&self) -> bool

§

impl<T> NetworkInfo for Arc<T>
where T: NetworkInfo + ?Sized, Arc<T>: Send + Sync,

§

fn local_addr(&self) -> SocketAddr

§

fn network_status( &self, ) -> impl Future<Output = Result<NetworkStatus, NetworkError>> + Send

§

fn chain_id(&self) -> u64

§

fn cell_custody(&self) -> &CellCustody

§

fn is_syncing(&self) -> bool

§

fn is_initially_syncing(&self) -> bool

Implementors§

Source§

impl<N: NetworkPrimitives> NetworkInfo for NetworkHandle<N>

§

impl<Net> NetworkInfo for NoopNetwork<Net>
where Net: Send + Sync,