diff --git a/bin/reth/src/args/gas_price_oracle_args.rs b/bin/reth/src/args/gas_price_oracle_args.rs index d56c8ec8cd..9d417f3481 100644 --- a/bin/reth/src/args/gas_price_oracle_args.rs +++ b/bin/reth/src/args/gas_price_oracle_args.rs @@ -1,7 +1,7 @@ use clap::Args; /// Parameters to configure Gas Price Oracle -#[derive(Debug, Args, PartialEq, Eq, Default)] +#[derive(Debug, Clone, Args, PartialEq, Eq, Default)] #[command(next_help_heading = "Gas Price Oracle")] pub struct GasPriceOracleArgs { /// Number of recent blocks to check for gas price diff --git a/bin/reth/src/args/rpc_server_args.rs b/bin/reth/src/args/rpc_server_args.rs index aa12adaacf..fe936049a6 100644 --- a/bin/reth/src/args/rpc_server_args.rs +++ b/bin/reth/src/args/rpc_server_args.rs @@ -2,7 +2,11 @@ use crate::{ args::GasPriceOracleArgs, - cli::{components::RethRpcComponents, config::RethRpcConfig, ext::RethNodeCommandConfig}, + cli::{ + components::{RethNodeComponents, RethRpcComponents}, + config::RethRpcConfig, + ext::RethNodeCommandConfig, + }, }; use clap::{ builder::{PossibleValue, RangedU64ValueParser, TypedValueParser}, @@ -24,8 +28,6 @@ use reth_rpc::{ }, JwtError, JwtSecret, }; - -use crate::cli::components::RethNodeComponents; use reth_rpc_builder::{ auth::{AuthServerConfig, AuthServerHandle}, constants, @@ -55,7 +57,7 @@ pub(crate) const RPC_DEFAULT_MAX_RESPONSE_SIZE_MB: u32 = 115; pub(crate) const RPC_DEFAULT_MAX_CONNECTIONS: u32 = 500; /// Parameters for configuring the rpc more granularity via CLI -#[derive(Debug, Args)] +#[derive(Debug, Clone, Args)] #[command(next_help_heading = "RPC")] pub struct RpcServerArgs { /// Enable the HTTP-RPC server @@ -309,6 +311,10 @@ impl RethRpcConfig for RpcServerArgs { !self.ipcdisable } + fn ipc_path(&self) -> &str { + self.ipcpath.as_str() + } + fn eth_config(&self) -> EthConfig { EthConfig::default() .max_tracing_requests(self.rpc_max_tracing_requests) diff --git a/bin/reth/src/cli/config.rs b/bin/reth/src/cli/config.rs index 5c10a001a3..01eb395e9f 100644 --- a/bin/reth/src/cli/config.rs +++ b/bin/reth/src/cli/config.rs @@ -17,6 +17,9 @@ pub trait RethRpcConfig { /// Returns whether ipc is enabled. fn is_ipc_enabled(&self) -> bool; + /// Returns the path to the target ipc socket if enabled. + fn ipc_path(&self) -> &str; + /// The configured ethereum RPC settings. fn eth_config(&self) -> EthConfig; diff --git a/crates/rpc/rpc-builder/src/auth.rs b/crates/rpc/rpc-builder/src/auth.rs index cfe5459188..ee8d53ff31 100644 --- a/crates/rpc/rpc-builder/src/auth.rs +++ b/crates/rpc/rpc-builder/src/auth.rs @@ -141,6 +141,11 @@ impl AuthServerConfig { AuthServerConfigBuilder::new(secret) } + /// Returns the address the server will listen on. + pub fn address(&self) -> SocketAddr { + self.socket_addr + } + /// Convenience function to start a server in one step. pub async fn start(self, module: AuthRpcModule) -> Result { let Self { socket_addr, secret, server_config } = self;