Add solana-keygen

Same as solana-mint, but without a tokens field.
This commit is contained in:
Greg Fitzgerald 2018-07-12 11:59:40 -06:00 committed by Greg Fitzgerald
parent 0b66a6626a
commit 81c44c605b
2 changed files with 18 additions and 0 deletions

View File

@ -25,6 +25,10 @@ path = "src/bin/wallet.rs"
name = "solana-fullnode"
path = "src/bin/fullnode.rs"
[[bin]]
name = "solana-keygen"
path = "src/bin/keygen.rs"
[[bin]]
name = "solana-fullnode-config"
path = "src/bin/fullnode-config.rs"

14
src/bin/keygen.rs Normal file
View File

@ -0,0 +1,14 @@
extern crate ring;
extern crate serde_json;
use ring::rand::SystemRandom;
use ring::signature::Ed25519KeyPair;
use std::error;
fn main() -> Result<(), Box<error::Error>> {
let rnd = SystemRandom::new();
let pkcs8_bytes = Ed25519KeyPair::generate_pkcs8(&rnd)?;
let serialized = serde_json::to_string(&pkcs8_bytes.to_vec())?;
println!("{}", serialized);
Ok(())
}