Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion bin/node/src/commands/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use clap::Parser;
use kona_cli::metrics_args::MetricsArgs;
use kona_engine::EngineKind;
use kona_genesis::RollupConfig;
use kona_node_service::{RollupNode, RollupNodeService};
use kona_node_service::{NodeMode, RollupNode, RollupNodeService};
use op_alloy_provider::ext::engine::OpEngineApi;
use serde_json::from_reader;
use std::{fs::File, path::PathBuf, sync::Arc};
Expand All @@ -27,6 +27,14 @@ use url::Url;
#[derive(Parser, PartialEq, Debug, Clone)]
#[command(about = "Runs the consensus node")]
pub struct NodeCommand {
/// The mode to run the node in.
#[arg(
long = "mode",
default_value_t = NodeMode::Validator,
env = "KONA_NODE_MODE",
help = "The mode to run the node in. Supported modes are: [\"validator\", \"sequencer\"]"
)]
pub node_mode: NodeMode,
/// URL of the L1 execution client RPC API.
#[arg(long, visible_alias = "l1", env = "KONA_NODE_L1_ETH_RPC")]
pub l1_eth_rpc: Url,
Expand Down Expand Up @@ -90,6 +98,7 @@ impl Default for NodeCommand {
l2_engine_jwt_secret: None,
l2_config_file: None,
l1_runtime_config_reload_interval: 600,
node_mode: NodeMode::Validator,
p2p_flags: P2PArgs::default(),
rpc_flags: RpcArgs::default(),
sequencer_flags: SequencerArgs::default(),
Expand Down Expand Up @@ -221,6 +230,7 @@ impl NodeCommand {
}

RollupNode::builder(cfg)
.with_mode(self.node_mode)
.with_jwt_secret(jwt_secret)
.with_l1_provider_rpc_url(self.l1_eth_rpc)
.with_l1_beacon_api_url(self.l1_beacon)
Expand Down
9 changes: 0 additions & 9 deletions bin/node/src/flags/sequencer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ use std::{net::SocketAddr, num::ParseIntError, time::Duration};
/// Sequencer CLI Flags
#[derive(Parser, Clone, Debug, PartialEq, Eq)]
pub struct SequencerArgs {
/// Enable sequencing of new L2 blocks. A separate batch submitter has to be deployed to
/// publish the data for verifiers.
#[arg(
long = "sequencer.enabled",
default_value = "false",
env = "KONA_NODE_SEQUENCER_ENABLED"
)]
pub enabled: bool,

/// Initialize the sequencer in a stopped state. The sequencer can be started using the
/// admin_startSequencer RPC.
#[arg(
Expand Down
4 changes: 3 additions & 1 deletion crates/node/service/src/service/mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
/// The [`NodeMode`] enum represents the modes of operation for the [`RollupNodeService`].
///
/// [`RollupNodeService`]: crate::RollupNodeService
#[derive(Debug, derive_more::Display, Default, Clone, Copy, PartialEq, Eq)]
#[derive(
Debug, derive_more::Display, derive_more::FromStr, Default, Clone, Copy, PartialEq, Eq,
)]
pub enum NodeMode {
/// Validator mode.
#[display("Validator")]
Expand Down
7 changes: 6 additions & 1 deletion crates/node/service/src/service/standard/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ impl RollupNodeBuilder {
Self { interop_mode, ..self }
}

/// Sets the [`NodeMode`] on the [`RollupNodeBuilder`].
pub fn with_mode(self, mode: NodeMode) -> Self {
Self { mode, ..self }
}

/// Appends the [`SupervisorRpcConfig`] to the builder.
pub fn with_supervisor_rpc_config(self, config: SupervisorRpcConfig) -> Self {
Self { supervisor_rpc_config: config, ..self }
Expand Down Expand Up @@ -160,6 +165,7 @@ impl RollupNodeBuilder {
};

RollupNode {
mode: self.mode,
config: rollup_config,
interop_mode,
l1_provider,
Expand All @@ -171,7 +177,6 @@ impl RollupNodeBuilder {
p2p_config,
// By default, the supervisor rpc config is disabled.
supervisor_rpc: self.supervisor_rpc_config,
mode: self.mode,
}
}
}
Loading