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§
sourcefn provider(
&self,
) -> impl ChainSpecProvider<ChainSpec = ChainSpec> + BlockNumReader + StageCheckpointReader
fn provider( &self, ) -> impl ChainSpecProvider<ChainSpec = ChainSpec> + BlockNumReader + StageCheckpointReader
Returns a handle for reading data from disk.
sourcefn starting_block(&self) -> U256
fn starting_block(&self) -> U256
Returns the block node is started on.
Provided Methods§
sourcefn protocol_version(&self) -> impl Future<Output = RethResult<U64>> + Send
fn protocol_version(&self) -> impl Future<Output = RethResult<U64>> + Send
Returns the current ethereum protocol version.
sourcefn chain_info(&self) -> RethResult<ChainInfo>
fn chain_info(&self) -> RethResult<ChainInfo>
Returns provider chain info
sourcefn is_syncing(&self) -> bool
fn is_syncing(&self) -> bool
Returns true
if the network is undergoing sync.
sourcefn sync_status(&self) -> RethResult<SyncStatus>
fn sync_status(&self) -> RethResult<SyncStatus>
Returns the [SyncStatus
] of the network
sourcefn chain_spec(&self) -> Arc<ChainSpec>
fn chain_spec(&self) -> Arc<ChainSpec>
Returns the configured [ChainSpec
].
Object Safety§
This trait is not object safe.