Skip to content

Commit

Permalink
chore(cli): Add warning for misconfigured HTTP API flags (#11360)
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Cline <6798349+Rjected@users.noreply.github.com>
  • Loading branch information
TheDhejavu and Rjected authored Oct 1, 2024
1 parent c2cabca commit 6bbb07b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/rpc/rpc-builder/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use reth_rpc_eth_types::{EthConfig, EthStateCacheConfig, GasPriceOracleConfig};
use reth_rpc_layer::{JwtError, JwtSecret};
use reth_rpc_server_types::RpcModuleSelection;
use tower::layer::util::Identity;
use tracing::debug;
use tracing::{debug, warn};

use crate::{
auth::AuthServerConfig, error::RpcError, IpcServerBuilder, RpcModuleConfig, RpcServerConfig,
Expand Down Expand Up @@ -168,6 +168,13 @@ impl RethRpcServerConfig for RpcServerArgs {
fn rpc_server_config(&self) -> RpcServerConfig {
let mut config = RpcServerConfig::default().with_jwt_secret(self.rpc_secret_key());

if self.http_api.is_some() && !self.http {
warn!(
target: "reth::cli",
"The --http.api flag is set but --http is not enabled. HTTP RPC API will not be exposed."
);
}

if self.http {
let socket_address = SocketAddr::new(self.http_addr, self.http_port);
config = config
Expand Down

0 comments on commit 6bbb07b

Please sign in to comment.