ghost-node/utils/ghostkey/src/lib.rs
Uncle Stretch 66719626bb
inital commit, which is clearly not initial
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-03 15:38:52 +03:00

36 lines
914 B
Rust
Executable File

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(),
}
}