Skip to main content

EthApiSpec

Trait EthApiSpec 

Source
pub trait EthApiSpec: RpcNodeCore + EthApiTypes {
    // Required method
    fn starting_block(&self) -> U256;

    // Provided methods
    fn protocol_version(&self) -> impl Future<Output = RethResult<U64>> + Send { ... }
    fn chain_id(&self) -> U64 { ... }
    fn chain_info(&self) -> RethResult<ChainInfo> { ... }
    fn capabilities(&self) -> RethResult<EthCapabilities>
       where Self: EthState { ... }
    fn is_syncing(&self) -> bool { ... }
    fn sync_status(&self) -> RethResult<SyncStatus> { ... }
}
Expand description

Eth API trait.

Defines core functionality of the eth API implementation.

Required Methods§

Source

fn starting_block(&self) -> U256

Returns the block node is started on.

Provided Methods§

Source

fn protocol_version(&self) -> impl Future<Output = RethResult<U64>> + Send

Returns the current ethereum protocol version.

Source

fn chain_id(&self) -> U64

Returns the chain id

Source

fn chain_info(&self) -> RethResult<ChainInfo>

Returns provider chain info

Source

fn capabilities(&self) -> RethResult<EthCapabilities>
where Self: EthState,

Returns effective routing capabilities for this node.

The response follows the eth_capabilities execution API proposal: https://github.com/ethereum/execution-apis/pull/755.

Source

fn is_syncing(&self) -> bool

Returns true if the network is undergoing sync.

Source

fn sync_status(&self) -> RethResult<SyncStatus>

Returns the [SyncStatus] of the network

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<'a, T: 'a + EthApiSpec + ?Sized + EthState> EthApiSpec for &'a T

Source§

fn starting_block(&self) -> U256

Source§

fn protocol_version(&self) -> impl Future<Output = RethResult<U64>> + Send

Source§

fn chain_id(&self) -> U64

Source§

fn chain_info(&self) -> RethResult<ChainInfo>

Source§

fn capabilities(&self) -> RethResult<EthCapabilities>
where Self: EthState,

Source§

fn is_syncing(&self) -> bool

Source§

fn sync_status(&self) -> RethResult<SyncStatus>

Source§

impl<T: EthApiSpec + ?Sized + EthState> EthApiSpec for Arc<T>

Source§

fn starting_block(&self) -> U256

Source§

fn protocol_version(&self) -> impl Future<Output = RethResult<U64>> + Send

Source§

fn chain_id(&self) -> U64

Source§

fn chain_info(&self) -> RethResult<ChainInfo>

Source§

fn capabilities(&self) -> RethResult<EthCapabilities>
where Self: EthState,

Source§

fn is_syncing(&self) -> bool

Source§

fn sync_status(&self) -> RethResult<SyncStatus>

Implementors§