Move solana-keygen into keygen/
This commit is contained in:
parent
cafeef33c3
commit
282d4a3563
|
@ -1763,6 +1763,7 @@ dependencies = [
|
|||
"solana-jsonrpc-macros 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"solana-jsonrpc-pubsub 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"solana-jsonrpc-ws-server 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"solana-keygen 0.11.0",
|
||||
"solana-lualoader 0.11.0",
|
||||
"solana-metrics 0.11.0",
|
||||
"solana-native-loader 0.11.0",
|
||||
|
@ -1978,6 +1979,15 @@ dependencies = [
|
|||
"solana-ws 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-keygen"
|
||||
version = "0.11.0"
|
||||
dependencies = [
|
||||
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"dirs 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"solana-sdk 0.11.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-lualoader"
|
||||
version = "0.11.0"
|
||||
|
@ -2029,6 +2039,8 @@ dependencies = [
|
|||
"bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"dirs 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"generic-array 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
|
@ -44,10 +44,6 @@ path = "src/bin/genesis.rs"
|
|||
name = "solana-ledger-tool"
|
||||
path = "src/bin/ledger-tool.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "solana-keygen"
|
||||
path = "src/bin/keygen.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "solana-wallet"
|
||||
path = "src/bin/wallet.rs"
|
||||
|
@ -106,6 +102,7 @@ solana-jsonrpc-http-server = "0.4.0"
|
|||
solana-jsonrpc-macros = "0.4.0"
|
||||
solana-jsonrpc-pubsub = "0.4.0"
|
||||
solana-jsonrpc-ws-server = "0.4.0"
|
||||
solana-keygen = { path = "keygen", version = "0.11.0" }
|
||||
solana-lualoader = { path = "programs/native/lua_loader", version = "0.11.0" }
|
||||
solana-metrics = { path = "metrics", version = "0.11.0" }
|
||||
solana-native-loader = { path = "programs/native/native_loader", version = "0.11.0" }
|
||||
|
@ -145,6 +142,7 @@ name = "chacha"
|
|||
members = [
|
||||
".",
|
||||
"drone",
|
||||
"keygen",
|
||||
"metrics",
|
||||
"programs/bpf/rust/noop",
|
||||
"programs/native/bpf_loader",
|
||||
|
|
|
@ -12,6 +12,7 @@ cd "$(dirname "$0")/.."
|
|||
#
|
||||
CRATES=(
|
||||
sdk
|
||||
keygen
|
||||
metrics
|
||||
drone
|
||||
programs/native/{budget,bpf_loader,lua_loader,native_loader,noop,system,vote}
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
[package]
|
||||
name = "solana-keygen"
|
||||
version = "0.11.0"
|
||||
description = "Solana key generation utility"
|
||||
authors = ["Solana Maintainers <maintainers@solana.com>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
dirs = "1.0.2"
|
||||
clap = "2.31"
|
||||
solana-sdk = { path = "../sdk", version = "0.11.0" }
|
||||
|
||||
[[bin]]
|
||||
name = "solana-keygen"
|
||||
path = "src/keygen.rs"
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
#[macro_use]
|
||||
extern crate clap;
|
||||
use dirs;
|
||||
extern crate dirs;
|
||||
extern crate solana_sdk;
|
||||
|
||||
use clap::{App, Arg};
|
||||
use solana_sdk::signature::gen_keypair_file;
|
|
@ -44,7 +44,7 @@ elif [[ -n $USE_SNAP ]]; then # Use the Linux Snap binaries
|
|||
declare program="$1"
|
||||
printf "solana.%s" "$program"
|
||||
}
|
||||
elif [[ -n $USE_INSTALL ]]; then # Assume |cargo install| was run
|
||||
elif [[ -n $USE_INSTALL ]]; then # Assume |./scripts/cargo-install-all.sh| was run
|
||||
solana_program() {
|
||||
declare program="$1"
|
||||
printf "solana-%s" "$program"
|
||||
|
@ -57,8 +57,9 @@ else
|
|||
program=${BASH_REMATCH[1]}
|
||||
features="--features=cuda"
|
||||
fi
|
||||
if [[ "$program" = drone ]]; then
|
||||
maybe_package="--package solana-drone"
|
||||
|
||||
if [[ -r "$(dirname "${BASH_SOURCE[0]}")"/../"$program"/Cargo.toml ]]; then
|
||||
maybe_package="--package solana-$program"
|
||||
fi
|
||||
if [[ -n $NDEBUG ]]; then
|
||||
maybe_release=--release
|
||||
|
|
|
@ -7,4 +7,5 @@ cd "$(dirname "$0")/.."
|
|||
|
||||
set -x
|
||||
cargo install --path drone "$@"
|
||||
cargo install --path keygen "$@"
|
||||
cargo install --path . "$@"
|
||||
|
|
|
@ -10,7 +10,9 @@ license = "Apache-2.0"
|
|||
bincode = "1.0.0"
|
||||
byteorder = "1.2.1"
|
||||
bs58 = "0.2.0"
|
||||
dirs = "1.0.2"
|
||||
chrono = { version = "0.4.0", features = ["serde"] }
|
||||
clap = "2.31"
|
||||
generic-array = { version = "0.12.0", default-features = false, features = ["serde"] }
|
||||
log = "0.4.2"
|
||||
ring = "0.13.2"
|
||||
|
@ -20,3 +22,8 @@ serde_derive = "1.0.82"
|
|||
serde_json = "1.0.10"
|
||||
untrusted = "0.6.2"
|
||||
|
||||
[[bin]]
|
||||
name = "solana-keygen"
|
||||
path = "src/bin/keygen.rs"
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
#[macro_use]
|
||||
extern crate clap;
|
||||
extern crate dirs;
|
||||
extern crate solana_sdk;
|
||||
|
||||
use clap::{App, Arg};
|
||||
use solana_sdk::signature::gen_keypair_file;
|
||||
use std::error;
|
||||
|
||||
fn main() -> Result<(), Box<dyn error::Error>> {
|
||||
let matches = App::new("solana-keygen")
|
||||
.version(crate_version!())
|
||||
.arg(
|
||||
Arg::with_name("outfile")
|
||||
.short("o")
|
||||
.long("outfile")
|
||||
.value_name("PATH")
|
||||
.takes_value(true)
|
||||
.help("Path to generated file"),
|
||||
)
|
||||
.get_matches();
|
||||
|
||||
let mut path = dirs::home_dir().expect("home directory");
|
||||
let outfile = if matches.is_present("outfile") {
|
||||
matches.value_of("outfile").unwrap()
|
||||
} else {
|
||||
path.extend(&[".config", "solana", "id.json"]);
|
||||
path.to_str().unwrap()
|
||||
};
|
||||
|
||||
let serialized_keypair = gen_keypair_file(outfile.to_string())?;
|
||||
if outfile == "-" {
|
||||
println!("{}", serialized_keypair);
|
||||
}
|
||||
Ok(())
|
||||
}
|
Loading…
Reference in New Issue