block_template_to_proposal/args.rs
1//! block-template-to-proposal arguments
2//!
3//! For usage please refer to the program help: `block-template-to-proposal --help`
4
5use clap::Parser;
6
7use zebra_chain::parameters::Network;
8use zebra_rpc::client::BlockTemplateTimeSource;
9
10/// block-template-to-proposal arguments
11#[derive(Clone, Debug, Eq, PartialEq, Parser)]
12#[command(version)]
13pub struct Args {
14 /// The network to use for the block proposal.
15 #[arg(default_value = "Mainnet", short, long)]
16 pub net: Network,
17
18 /// The source of the time in the block proposal header.
19 /// Format: "curtime", "mintime", "maxtime", ["clamped"]u32, "raw"u32
20 /// Clamped times are clamped to the template's [`mintime`, `maxtime`].
21 /// Raw times are used unmodified: this can produce invalid proposals.
22 #[arg(default_value = "CurTime", short, long)]
23 pub time_source: BlockTemplateTimeSource,
24
25 /// The JSON block template.
26 /// If this argument is not supplied, the template is read from standard input.
27 ///
28 /// The template and proposal structures are printed to stderr.
29 #[arg(last = true)]
30 pub template: Option<String>,
31}