-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
C-enhancementNew feature or requestNew feature or requestD-good-first-issueNice and easy! A great choice to get startedNice and easy! A great choice to get started
Description
Describe the feature
ideally we have the same fns:
reth/crates/node/builder/src/rpc.rs
Lines 408 to 441 in 9089672
| /// Maps the [`EngineApiBuilder`] builder type. | |
| pub fn with_engine_api<T>(self, engine_api_builder: T) -> RpcAddOns<Node, EthB, EV, T> { | |
| let Self { hooks, eth_api_builder, engine_validator_builder, .. } = self; | |
| RpcAddOns { hooks, eth_api_builder, engine_validator_builder, engine_api_builder } | |
| } | |
| /// Maps the [`EngineValidatorBuilder`] builder type. | |
| pub fn with_engine_validator<T>( | |
| self, | |
| engine_validator_builder: T, | |
| ) -> RpcAddOns<Node, EthB, T, EB> { | |
| let Self { hooks, eth_api_builder, engine_api_builder, .. } = self; | |
| RpcAddOns { hooks, eth_api_builder, engine_validator_builder, engine_api_builder } | |
| } | |
| /// Sets the hook that is run once the rpc server is started. | |
| pub fn on_rpc_started<F>(mut self, hook: F) -> Self | |
| where | |
| F: FnOnce(RpcContext<'_, Node, EthB::EthApi>, RethRpcServerHandles) -> eyre::Result<()> | |
| + Send | |
| + 'static, | |
| { | |
| self.hooks.set_on_rpc_started(hook); | |
| self | |
| } | |
| /// Sets the hook that is run to configure the rpc modules. | |
| pub fn extend_rpc_modules<F>(mut self, hook: F) -> Self | |
| where | |
| F: FnOnce(RpcContext<'_, Node, EthB::EthApi>) -> eyre::Result<()> + Send + 'static, | |
| { | |
| self.hooks.set_extend_rpc_modules(hook); | |
| self | |
| } |
so that we can use this directly on OpAddons, instead of:
OpAddOns::default().rpc_add_ons.with_engine_api(...)
ref #16248
Additional context
No response
Metadata
Metadata
Assignees
Labels
C-enhancementNew feature or requestNew feature or requestD-good-first-issueNice and easy! A great choice to get startedNice and easy! A great choice to get started
Type
Projects
Status
Done