diff --git a/bin/reth/src/args/rpc_server_args.rs b/bin/reth/src/args/rpc_server_args.rs index 2b401685c9..87fe8c48a3 100644 --- a/bin/reth/src/args/rpc_server_args.rs +++ b/bin/reth/src/args/rpc_server_args.rs @@ -25,7 +25,7 @@ use std::{ net::{IpAddr, Ipv4Addr, SocketAddr}, path::{Path, PathBuf}, }; -use tracing::info; +use tracing::{debug, info}; /// Parameters for configuring the rpc more granularity via CLI #[derive(Debug, Args, PartialEq, Default)] @@ -153,13 +153,16 @@ impl RpcServerArgs { { let auth_config = self.auth_server_config(jwt_secret)?; + let module_config = self.transport_rpc_module_config(); + debug!(target: "reth::cli", http=?module_config.http(), ws=?module_config.ws(), "Using RPC module config"); + let (rpc_modules, auth_module) = RpcModuleBuilder::default() .with_client(client) .with_pool(pool) .with_network(network) .with_events(events) .with_executor(executor) - .build_with_auth_server(self.transport_rpc_module_config(), engine_api); + .build_with_auth_server(module_config, engine_api); let server_config = self.rpc_server_config(); let has_server = server_config.has_server(); diff --git a/crates/rpc/rpc-builder/src/lib.rs b/crates/rpc/rpc-builder/src/lib.rs index 00bc7b3e0f..0b0aa7f389 100644 --- a/crates/rpc/rpc-builder/src/lib.rs +++ b/crates/rpc/rpc-builder/src/lib.rs @@ -514,6 +514,16 @@ impl FromStr for RpcModuleSelection { } } +impl fmt::Display for RpcModuleSelection { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!( + f, + "[{}]", + self.iter_selection().map(|s| s.to_string()).collect::>().join(", ") + ) + } +} + /// Represents RPC modules that are supported by reth #[derive( Debug, Clone, Copy, Eq, PartialEq, Hash, AsRefStr, EnumVariantNames, EnumString, Deserialize, @@ -1248,6 +1258,11 @@ pub struct TransportRpcModules { // === impl TransportRpcModules === impl TransportRpcModules<()> { + /// Returns the [TransportRpcModuleConfig] used to configure this instance. + pub fn module_config(&self) -> &TransportRpcModuleConfig { + &self.config + } + /// Convenience function for starting a server pub async fn start_server(self, builder: RpcServerConfig) -> Result { builder.start(self).await