MCPcopy Create free account
hub / github.com/base/base / with_rpc_middleware

Method with_rpc_middleware

crates/execution/node/src/node.rs:537–555  ·  view source on GitHub ↗

Sets the RPC middleware stack for processing RPC requests. This method configures a custom middleware stack that will be applied to all RPC requests across HTTP, `WebSocket`, and IPC transports. The middleware is applied to the RPC service layer, allowing you to intercept, modify, or enhance RPC request processing. See also [`RpcAddOns::with_rpc_middleware`].

(self, rpc_middleware: T)

Source from the content-addressed store, hash-verified

535 ///
536 /// See also [`RpcAddOns::with_rpc_middleware`].
537 pub fn with_rpc_middleware<T>(self, rpc_middleware: T) -> BaseAddOns<N, EthB, PVB, EB, EVB, T> {
538 let Self {
539 rpc_add_ons,
540 da_config,
541 gas_limit_config,
542 sequencer_url,
543 sequencer_headers,
544 min_suggested_priority_fee,
545 ..
546 } = self;
547 BaseAddOns::new(
548 rpc_add_ons.with_rpc_middleware(rpc_middleware),
549 da_config,
550 gas_limit_config,
551 sequencer_url,
552 sequencer_headers,
553 min_suggested_priority_fee,
554 )
555 }
556
557 /// Sets the hook that is run once the rpc server is started.
558 pub fn on_rpc_started<F>(mut self, hook: F) -> Self

Callers

nothing calls this directly

Calls 1

newFunction · 0.50

Tested by

no test coverage detected