diff --git a/crates/optimism/cli/src/commands/mod.rs b/crates/optimism/cli/src/commands/mod.rs index a1e13dd779d6..1c2172d67f3b 100644 --- a/crates/optimism/cli/src/commands/mod.rs +++ b/crates/optimism/cli/src/commands/mod.rs @@ -2,6 +2,8 @@ use crate::chainspec::OpChainSpecParser; use clap::Subcommand; use import::ImportOpCommand; use import_receipts::ImportReceiptsOpCommand; +use reth_chainspec::ChainSpec; +use reth_cli::chainspec::ChainSpecParser; use reth_cli_commands::{ config_cmd, db, dump_genesis, init_cmd, init_state, node::{self, NoArgs}, @@ -16,40 +18,43 @@ pub mod import_receipts; /// Commands to be executed #[derive(Debug, Subcommand)] -pub enum Commands { +pub enum Commands< + Spec: ChainSpecParser = OpChainSpecParser, + Ext: clap::Args + fmt::Debug = NoArgs, +> { /// Start the node #[command(name = "node")] - Node(Box>), + Node(Box>), /// Initialize the database from a genesis file. #[command(name = "init")] - Init(init_cmd::InitCommand), + Init(init_cmd::InitCommand), /// Initialize the database from a state dump file. #[command(name = "init-state")] - InitState(init_state::InitStateCommand), + InitState(init_state::InitStateCommand), /// This syncs RLP encoded OP blocks below Bedrock from a file, without executing. #[command(name = "import-op")] - ImportOp(ImportOpCommand), + ImportOp(ImportOpCommand), /// This imports RLP encoded receipts from a file. #[command(name = "import-receipts-op")] - ImportReceiptsOp(ImportReceiptsOpCommand), + ImportReceiptsOp(ImportReceiptsOpCommand), /// Dumps genesis block JSON configuration to stdout. - DumpGenesis(dump_genesis::DumpGenesisCommand), + DumpGenesis(dump_genesis::DumpGenesisCommand), /// Database debugging utilities #[command(name = "db")] - Db(db::Command), + Db(db::Command), /// Manipulate individual stages. #[command(name = "stage")] - Stage(Box>), + Stage(Box>), /// P2P Debugging utilities #[command(name = "p2p")] - P2P(p2p::Command), + P2P(p2p::Command), /// Write config to stdout #[command(name = "config")] Config(config_cmd::Command), /// Scripts for node recovery #[command(name = "recover")] - Recover(recover::Command), + Recover(recover::Command), /// Prune according to the configuration without any limits #[command(name = "prune")] - Prune(prune::PruneCommand), + Prune(prune::PruneCommand), } diff --git a/crates/optimism/cli/src/lib.rs b/crates/optimism/cli/src/lib.rs index 06c04bf55fe4..e2d06e00a7bf 100644 --- a/crates/optimism/cli/src/lib.rs +++ b/crates/optimism/cli/src/lib.rs @@ -61,7 +61,7 @@ pub struct Cli< > { /// The command to run #[command(subcommand)] - command: Commands, + command: Commands, /// The chain this node is running. ///