mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
chore: make some fields owned (#12274)
This commit is contained in:
@ -91,17 +91,17 @@ pub trait FullNodeComponents: FullNodeTypes + Clone + 'static {
|
||||
}
|
||||
|
||||
/// Context passed to [`NodeAddOns::launch_add_ons`],
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct AddOnsContext<'a, N: FullNodeComponents> {
|
||||
/// Node with all configured components.
|
||||
pub node: &'a N,
|
||||
pub node: N,
|
||||
/// Node configuration.
|
||||
pub config: &'a NodeConfig<<N::Types as NodeTypes>::ChainSpec>,
|
||||
/// Handle to the beacon consensus engine.
|
||||
pub beacon_engine_handle:
|
||||
&'a BeaconConsensusEngineHandle<<N::Types as NodeTypesWithEngine>::Engine>,
|
||||
BeaconConsensusEngineHandle<<N::Types as NodeTypesWithEngine>::Engine>,
|
||||
/// JWT secret for the node.
|
||||
pub jwt_secret: &'a JwtSecret,
|
||||
pub jwt_secret: JwtSecret,
|
||||
}
|
||||
|
||||
/// Customizable node add-on types.
|
||||
|
||||
@ -286,10 +286,10 @@ where
|
||||
let jwt_secret = ctx.auth_jwt_secret()?;
|
||||
|
||||
let add_ons_ctx = AddOnsContext {
|
||||
node: ctx.node_adapter(),
|
||||
node: ctx.node_adapter().clone(),
|
||||
config: ctx.node_config(),
|
||||
beacon_engine_handle: &beacon_engine_handle,
|
||||
jwt_secret: &jwt_secret,
|
||||
beacon_engine_handle,
|
||||
jwt_secret,
|
||||
};
|
||||
|
||||
let RpcHandle { rpc_server_handles, rpc_registry } =
|
||||
|
||||
@ -329,10 +329,10 @@ where
|
||||
let jwt_secret = ctx.auth_jwt_secret()?;
|
||||
|
||||
let add_ons_ctx = AddOnsContext {
|
||||
node: ctx.node_adapter(),
|
||||
node: ctx.node_adapter().clone(),
|
||||
config: ctx.node_config(),
|
||||
beacon_engine_handle: &beacon_engine_handle,
|
||||
jwt_secret: &jwt_secret,
|
||||
beacon_engine_handle,
|
||||
jwt_secret,
|
||||
};
|
||||
|
||||
let RpcHandle { rpc_server_handles, rpc_registry } =
|
||||
|
||||
@ -409,9 +409,11 @@ where
|
||||
type Handle = RpcHandle<N, EthApi>;
|
||||
|
||||
async fn launch_add_ons(self, ctx: AddOnsContext<'_, N>) -> eyre::Result<Self::Handle> {
|
||||
let AddOnsContext { node, config, beacon_engine_handle, jwt_secret } = ctx;
|
||||
let Self { eth_api_builder, engine_validator_builder, hooks, _pd: _ } = self;
|
||||
|
||||
let engine_validator = engine_validator_builder.build(&ctx).await?;
|
||||
let AddOnsContext { node, config, beacon_engine_handle, jwt_secret } = ctx;
|
||||
|
||||
let client = ClientVersionV1 {
|
||||
code: CLIENT_CODE,
|
||||
name: NAME_CLIENT.to_string(),
|
||||
@ -422,17 +424,17 @@ where
|
||||
let engine_api = EngineApi::new(
|
||||
node.provider().clone(),
|
||||
config.chain.clone(),
|
||||
beacon_engine_handle.clone(),
|
||||
beacon_engine_handle,
|
||||
node.payload_builder().clone().into(),
|
||||
node.pool().clone(),
|
||||
Box::new(node.task_executor().clone()),
|
||||
client,
|
||||
EngineCapabilities::default(),
|
||||
engine_validator_builder.build(&ctx).await?,
|
||||
engine_validator,
|
||||
);
|
||||
info!(target: "reth::cli", "Engine API handler initialized");
|
||||
|
||||
let auth_config = config.rpc.auth_server_config(*jwt_secret)?;
|
||||
let auth_config = config.rpc.auth_server_config(jwt_secret)?;
|
||||
let module_config = config.rpc.transport_rpc_module_config();
|
||||
debug!(target: "reth::cli", http=?module_config.http(), ws=?module_config.ws(), "Using RPC module config");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user