mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-29 09:08:05 -05:00
chore: add rpc module logs (#2608)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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::<Vec<_>>().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<Context> {
|
||||
// === 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<RpcServerHandle, RpcError> {
|
||||
builder.start(self).await
|
||||
|
||||
Reference in New Issue
Block a user