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