Trait reth_node_core::rpc::eth::helpers::spec::EthApiSpec

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) -> Uint<256, 4>;
    fn signers(&self) -> &RwLock<RawRwLock, Vec<Box<dyn EthSigner>>>;

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

Eth API trait.

Defines core functionality of the eth API implementation.

Required Methods§

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

Returns a handle for reading data from disk.

fn network(&self) -> impl NetworkInfo

Returns a handle for reading network data summary.

fn starting_block(&self) -> Uint<256, 4>

Returns the block node is started on.

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

Returns a handle to the signers owned by provider.

Provided Methods§

fn protocol_version( &self, ) -> impl Future<Output = Result<Uint<64, 1>, RethError>> + Send

Returns the current ethereum protocol version.

fn chain_id(&self) -> Uint<64, 1>

Returns the chain id

fn chain_info(&self) -> Result<ChainInfo, RethError>

Returns provider chain info

fn accounts(&self) -> Vec<Address>

Returns a list of addresses owned by provider.

fn is_syncing(&self) -> bool

Returns true if the network is undergoing sync.

fn sync_status(&self) -> Result<SyncStatus, RethError>

Returns the SyncStatus of the network

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

Returns the configured [ChainSpec].

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

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

§

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

§

fn network(&self) -> impl NetworkInfo

§

fn starting_block(&self) -> Uint<256, 4>

§

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

§

fn protocol_version( &self, ) -> impl Future<Output = Result<Uint<64, 1>, RethError>> + Send

§

fn chain_id(&self) -> Uint<64, 1>

§

fn chain_info(&self) -> Result<ChainInfo, RethError>

§

fn accounts(&self) -> Vec<Address>

§

fn is_syncing(&self) -> bool

§

fn sync_status(&self) -> Result<SyncStatus, RethError>

§

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

§

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

§

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

§

fn network(&self) -> impl NetworkInfo

§

fn starting_block(&self) -> Uint<256, 4>

§

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

§

fn protocol_version( &self, ) -> impl Future<Output = Result<Uint<64, 1>, RethError>> + Send

§

fn chain_id(&self) -> Uint<64, 1>

§

fn chain_info(&self) -> Result<ChainInfo, RethError>

§

fn accounts(&self) -> Vec<Address>

§

fn is_syncing(&self) -> bool

§

fn sync_status(&self) -> Result<SyncStatus, RethError>

§

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

Implementors§