feat: add --p2p-secret-key-hex which is similiar nodekeyhex in geth (#19670)

Co-authored-by: weixie.cui <weixie.cui@okg.com>
This commit is contained in:
cui
2025-11-12 20:15:03 +08:00
committed by GitHub
parent d9537a416a
commit 8479f286ea
11 changed files with 178 additions and 12 deletions

View File

@@ -12,7 +12,6 @@ use crate::{
use alloy_eips::eip4844::env_settings::EnvKzgSettings;
use futures::Future;
use reth_chainspec::{EthChainSpec, EthereumHardforks, Hardforks};
use reth_cli_util::get_secret_key;
use reth_db_api::{database::Database, database_metrics::DatabaseMetrics};
use reth_exex::ExExContext;
use reth_network::{
@@ -869,9 +868,7 @@ impl<Node: FullNodeTypes> BuilderContext<Node> {
/// Get the network secret from the given data dir
fn network_secret(&self, data_dir: &ChainPath<DataDirPath>) -> eyre::Result<SecretKey> {
let network_secret_path =
self.config().network.p2p_secret_key.clone().unwrap_or_else(|| data_dir.p2p_secret());
let secret_key = get_secret_key(&network_secret_path)?;
let secret_key = self.config().network.secret_key(data_dir.p2p_secret())?;
Ok(secret_key)
}