Add solana-keygen
Same as solana-mint, but without a tokens field.
This commit is contained in:
parent
0b66a6626a
commit
81c44c605b
|
@ -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"
|
||||
|
|
|
@ -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(())
|
||||
}
|
Loading…
Reference in New Issue