staging_node_cli/cli.rs
1// This file is part of Substrate.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
5
6// This program is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// You should have received a copy of the GNU General Public License
17// along with this program. If not, see <https://www.gnu.org/licenses/>.
18
19use polkadot_sdk::*;
20
21/// An overarching CLI command definition.
22#[derive(Debug, clap::Parser)]
23pub struct Cli {
24 /// Possible subcommand with parameters.
25 #[command(subcommand)]
26 pub subcommand: Option<Subcommand>,
27
28 #[allow(missing_docs)]
29 #[clap(flatten)]
30 pub run: sc_cli::RunCmd,
31
32 #[allow(missing_docs)]
33 #[clap(flatten)]
34 pub mixnet_params: sc_cli::MixnetParams,
35
36 /// Disable automatic hardware benchmarks.
37 ///
38 /// By default these benchmarks are automatically ran at startup and measure
39 /// the CPU speed, the memory bandwidth and the disk speed.
40 ///
41 /// The results are then printed out in the logs, and also sent as part of
42 /// telemetry, if telemetry is enabled.
43 #[arg(long)]
44 pub no_hardware_benchmarks: bool,
45
46 #[allow(missing_docs)]
47 #[clap(flatten)]
48 pub storage_monitor: sc_storage_monitor::StorageMonitorParams,
49}
50
51/// Possible subcommands of the main binary.
52#[derive(Debug, clap::Subcommand)]
53pub enum Subcommand {
54 /// The custom inspect subcommand for decoding blocks and extrinsics.
55 #[command(
56 name = "inspect",
57 about = "Decode given block or extrinsic using current native runtime."
58 )]
59 Inspect(node_inspect::cli::InspectCmd),
60
61 /// Sub-commands concerned with benchmarking.
62 ///
63 /// The pallet benchmarking moved to the `pallet` sub-command.
64 #[command(subcommand)]
65 Benchmark(frame_benchmarking_cli::BenchmarkCmd),
66
67 /// Key management cli utilities
68 #[command(subcommand)]
69 Key(sc_cli::KeySubcommand),
70
71 /// Verify a signature for a message, provided on STDIN, with a given (public or secret) key.
72 Verify(sc_cli::VerifyCmd),
73
74 /// Generate a seed that provides a vanity address.
75 Vanity(sc_cli::VanityCmd),
76
77 /// Sign a message, with a given (secret) key.
78 Sign(sc_cli::SignCmd),
79
80 /// Build a chain specification.
81 /// DEPRECATED: `build-spec` command will be removed after 1/04/2026. Use `export-chain-spec`
82 /// command instead.
83 #[deprecated(
84 note = "build-spec command will be removed after 1/04/2026. Use export-chain-spec command instead"
85 )]
86 BuildSpec(sc_cli::BuildSpecCmd),
87
88 /// Export the chain specification.
89 ExportChainSpec(sc_cli::ExportChainSpecCmd),
90
91 /// Validate blocks.
92 CheckBlock(sc_cli::CheckBlockCmd),
93
94 /// Export blocks.
95 ExportBlocks(sc_cli::ExportBlocksCmd),
96
97 /// Export the state of a given block into a chain spec.
98 ExportState(sc_cli::ExportStateCmd),
99
100 /// Import blocks.
101 ImportBlocks(sc_cli::ImportBlocksCmd),
102
103 /// Remove the whole chain.
104 PurgeChain(sc_cli::PurgeChainCmd),
105
106 /// Revert the chain to a previous state.
107 Revert(sc_cli::RevertCmd),
108
109 /// Db meta columns information.
110 ChainInfo(sc_cli::ChainInfoCmd),
111}