reth_optimism_cli/commands/
mod.rs

1use crate::chainspec::OpChainSpecParser;
2use clap::Subcommand;
3use import::ImportOpCommand;
4use import_receipts::ImportReceiptsOpCommand;
5use reth_cli::chainspec::ChainSpecParser;
6use reth_cli_commands::{
7    config_cmd, db, dump_genesis, init_cmd,
8    node::{self, NoArgs},
9    p2p, prune, recover, stage,
10};
11use std::fmt;
12
13pub mod import;
14pub mod import_receipts;
15pub mod init_state;
16
17#[cfg(feature = "dev")]
18pub mod test_vectors;
19
20/// Commands to be executed
21#[derive(Debug, Subcommand)]
22#[allow(clippy::large_enum_variant)]
23pub enum Commands<Spec: ChainSpecParser = OpChainSpecParser, Ext: clap::Args + fmt::Debug = NoArgs>
24{
25    /// Start the node
26    #[command(name = "node")]
27    Node(Box<node::NodeCommand<Spec, Ext>>),
28    /// Initialize the database from a genesis file.
29    #[command(name = "init")]
30    Init(init_cmd::InitCommand<Spec>),
31    /// Initialize the database from a state dump file.
32    #[command(name = "init-state")]
33    InitState(init_state::InitStateCommandOp<Spec>),
34    /// This syncs RLP encoded OP blocks below Bedrock from a file, without executing.
35    #[command(name = "import-op")]
36    ImportOp(ImportOpCommand<Spec>),
37    /// This imports RLP encoded receipts from a file.
38    #[command(name = "import-receipts-op")]
39    ImportReceiptsOp(ImportReceiptsOpCommand<Spec>),
40    /// Dumps genesis block JSON configuration to stdout.
41    DumpGenesis(dump_genesis::DumpGenesisCommand<Spec>),
42    /// Database debugging utilities
43    #[command(name = "db")]
44    Db(db::Command<Spec>),
45    /// Manipulate individual stages.
46    #[command(name = "stage")]
47    Stage(Box<stage::Command<Spec>>),
48    /// P2P Debugging utilities
49    #[command(name = "p2p")]
50    P2P(p2p::Command<Spec>),
51    /// Write config to stdout
52    #[command(name = "config")]
53    Config(config_cmd::Command),
54    /// Scripts for node recovery
55    #[command(name = "recover")]
56    Recover(recover::Command<Spec>),
57    /// Prune according to the configuration without any limits
58    #[command(name = "prune")]
59    Prune(prune::PruneCommand<Spec>),
60    /// Generate Test Vectors
61    #[cfg(feature = "dev")]
62    #[command(name = "test-vectors")]
63    TestVectors(test_vectors::Command),
64}