-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
585 additions
and
72 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,30 @@ authors = ["Zcash Foundation <[email protected]>"] | |
license = "MIT OR Apache-2.0" | ||
version = "1.0.0-beta.19" | ||
edition = "2021" | ||
|
||
# Prevent accidental publication of this utility crate. | ||
publish = false | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[[bin]] | ||
name = "block-template-to-proposal" | ||
# this setting is required for Zebra's Docker build caches | ||
path = "src/bin/block-template-to-proposal/main.rs" | ||
required-features = ["getblocktemplate-rpcs"] | ||
|
||
[features] | ||
default = [] | ||
|
||
# Production features that activate extra dependencies, or extra features in dependencies | ||
|
||
# Experimental mining RPC support | ||
getblocktemplate-rpcs = [ | ||
"zebra-rpc/getblocktemplate-rpcs", | ||
"zebra-node-services/getblocktemplate-rpcs", | ||
"zebra-chain/getblocktemplate-rpcs", | ||
] | ||
|
||
[dependencies] | ||
color-eyre = "0.6.2" | ||
# This is a transitive dependency via color-eyre. | ||
|
@@ -21,3 +42,6 @@ tracing-subscriber = "0.3.16" | |
|
||
zebra-node-services = { path = "../zebra-node-services" } | ||
zebra-chain = { path = "../zebra-chain" } | ||
|
||
# Experimental feature getblocktemplate-rpcs | ||
zebra-rpc = { path = "../zebra-rpc", optional = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//! block-template-to-proposal arguments | ||
//! | ||
//! For usage please refer to the program help: `block-template-to-proposal --help` | ||
|
||
use structopt::StructOpt; | ||
|
||
use zebra_rpc::methods::get_block_template_rpcs::get_block_template::proposal::TimeSource; | ||
|
||
/// block-template-to-proposal arguments | ||
#[derive(Clone, Debug, Eq, PartialEq, StructOpt)] | ||
pub struct Args { | ||
/// The source of the time in the block proposal header. | ||
/// Format: "curtime", "mintime", "maxtime", ["clamped"]u32, "raw"u32 | ||
/// Clamped times are clamped to the template's [`mintime`, `maxtime`]. | ||
/// Raw times are used unmodified: this can produce invalid proposals. | ||
#[structopt(default_value = "CurTime", short, long)] | ||
pub time_source: TimeSource, | ||
|
||
/// The JSON block template. | ||
/// If this argument is not supplied, the template is read from standard input. | ||
/// | ||
/// The template and proposal structures are printed to stderr. | ||
#[structopt(last = true)] | ||
pub template: Option<String>, | ||
} |
Oops, something went wrong.