inital commit, which is clearly not initial

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch
2024-10-03 15:38:52 +03:00
commit 66719626bb
178 changed files with 41709 additions and 0 deletions

21
utils/ghostkey/Cargo.toml Executable file
View File

@@ -0,0 +1,21 @@
[package]
name = "ghostkey"
version = "0.3.15"
description = "Generate and restore keys for chains such as Ghost and Casper"
license.workspace = true
authors.workspace = true
edition.workspace = true
homepage.workspace = true
repository.workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[[bin]]
name = "ghostkey"
path = "src/main.rs"
[dependencies]
clap = { workspace = true, features = ["derive"] }
sc-cli = { workspace = true, default-features = true }
ghost-client-cli = { workspace = true, default-features = true }

35
utils/ghostkey/src/lib.rs Executable file
View File

@@ -0,0 +1,35 @@
use clap::Parser;
use ghost_client_cli::{VanityCmd, KeySubcommand};
#[derive(Debug, Parser)]
#[command(
name = "ghostkey",
author = "f4t50",
about = "Ghost Key Tool",
version
)]
pub enum Ghostkey {
/// Key utility for the CLI
#[clap(flatten)]
KeyCli(KeySubcommand),
/// Sign a message, with a given (secret) key.
Sign(sc_cli::SignCmd),
/// Generate a seed that provides a vanity address/
Vanity(VanityCmd),
/// Verify a signature for a mesage, provided on STDIN, with a given
/// (public or secret) key.
Verify(sc_cli::VerifyCmd),
}
/// Run the ghostkey command, given the appropriate runtime.
pub fn run() -> Result<(), sc_cli::Error> {
match Ghostkey::parse() {
Ghostkey::KeyCli(cmd) => cmd.run(cli),
Ghostkey::Sign(cmd) => cmd.run(),
Ghostkey::Vanity(cmd) => cmd.run(),
Ghostkey::Verify(cmd) => cmd.run(),
}
}

5
utils/ghostkey/src/main.rs Executable file
View File

@@ -0,0 +1,5 @@
//! Ghostkey utility, based on kitchensink_runtime.
fn main() -> Result<(), sc_cli::Error> {
ghostkey::run()
}