feat: add ipc path to config (#4920)

This commit is contained in:
Matthias Seitz
2023-10-05 21:09:30 +02:00
committed by GitHub
parent a9b09a7552
commit 12c0bde9ec
4 changed files with 19 additions and 5 deletions

View File

@ -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

View File

@ -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)

View File

@ -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;