Trait reth_rpc_eth_api::helpers::spec::EthApiSpec

source ·
pub trait EthApiSpec: Send + Sync {
    // Required methods
    fn provider(
        &self,
    ) -> impl ChainSpecProvider<ChainSpec = ChainSpec> + BlockNumReader + StageCheckpointReader;
    fn network(&self) -> impl NetworkInfo;
    fn starting_block(&self) -> U256;
    fn signers(&self) -> &RwLock<Vec<Box<dyn EthSigner>>>;

    // Provided methods
    fn protocol_version(&self) -> impl Future<Output = RethResult<U64>> + Send { ... }
    fn chain_id(&self) -> U64 { ... }
    fn chain_info(&self) -> RethResult<ChainInfo> { ... }
    fn accounts(&self) -> Vec<Address> { ... }
    fn is_syncing(&self) -> bool { ... }
    fn sync_status(&self) -> RethResult<SyncStatus> { ... }
    fn chain_spec(&self) -> Arc<ChainSpec> { ... }
}
Expand description

Eth API trait.

Defines core functionality of the eth API implementation.

Required Methods§

source

fn provider( &self, ) -> impl ChainSpecProvider<ChainSpec = ChainSpec> + BlockNumReader + StageCheckpointReader

Returns a handle for reading data from disk.

source

fn network(&self) -> impl NetworkInfo

Returns a handle for reading network data summary.

source

fn starting_block(&self) -> U256

Returns the block node is started on.

source

fn signers(&self) -> &RwLock<Vec<Box<dyn EthSigner>>>

Returns a handle to the signers owned by provider.

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 accounts(&self) -> Vec<Address>

Returns a list of addresses owned by provider.

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

source

fn chain_spec(&self) -> Arc<ChainSpec>

Returns the configured [ChainSpec].

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

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

source§

fn provider( &self, ) -> impl ChainSpecProvider<ChainSpec = ChainSpec> + BlockNumReader + StageCheckpointReader

source§

fn network(&self) -> impl NetworkInfo

source§

fn starting_block(&self) -> U256

source§

fn signers(&self) -> &RwLock<Vec<Box<dyn EthSigner>>>

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 accounts(&self) -> Vec<Address>

source§

fn is_syncing(&self) -> bool

source§

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

source§

fn chain_spec(&self) -> Arc<ChainSpec>

source§

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

source§

fn provider( &self, ) -> impl ChainSpecProvider<ChainSpec = ChainSpec> + BlockNumReader + StageCheckpointReader

source§

fn network(&self) -> impl NetworkInfo

source§

fn starting_block(&self) -> U256

source§

fn signers(&self) -> &RwLock<Vec<Box<dyn EthSigner>>>

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 accounts(&self) -> Vec<Address>

source§

fn is_syncing(&self) -> bool

source§

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

source§

fn chain_spec(&self) -> Arc<ChainSpec>

Implementors§