mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add ipc path to config (#4920)
This commit is contained in:
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user