Added deterministic keypair generation.

- The Account Manager has a new subcommand, allowing generation of deterministic keys given a particular validator index.
 - Split functionality in generate_deterministic_keypair function
 - Fixed up READMEs to reflect new functionality & correct naming.
This commit is contained in:
Luke Anderson
2019-04-08 15:02:11 +10:00
parent a46f676f89
commit 177a351462
8 changed files with 69 additions and 15 deletions

View File

@@ -75,8 +75,9 @@ The configuration directory structure looks like:
Where the hex value of the directory is a portion of the validator public key.
Validator keys must be generated using the separate `accounts_manager` binary, which will
Validator keys must be generated using the separate `account_manager` binary, which will
place the keys into this directory structure in a format compatible with the validator client.
Be sure to check the readme for `account_manager`.
The chain specification (slot length, BLS domain, etc.) defaults to foundation
parameters, however is temporary and an upgrade will allow these parameters to be

View File

@@ -9,7 +9,7 @@ mod signer;
use crate::config::Config as ValidatorClientConfig;
use clap::{App, Arg};
use protos::services_grpc::ValidatorServiceClient;
use service::Service as ValidatorService;
use crate::service::Service as ValidatorService;
use slog::{error, info, o, Drain};
use types::Keypair;

View File

@@ -166,11 +166,15 @@ impl<B: BeaconNodeDuties + 'static, S: Signer + 'static> Service<B, S> {
/* Generate the duties manager */
// generate keypairs
// Load generated keypairs
let keypairs = match config.fetch_keys(&log) {
Some(kps) => Arc::new(kps),
None => panic!("No key pairs found, cannot start validator client without at least one. Try running `./account_manager generate` first.")
};
// TODO: keypairs are randomly generated; they should be loaded from a file or generated.
// https://github.com/sigp/lighthouse/issues/160
let keypairs = Arc::new(generate_deterministic_keypairs(8));
//let keypairs = Arc::new(generate_deterministic_keypairs(8));
// Builds a mapping of Epoch -> Map(PublicKey, EpochDuty)
// where EpochDuty contains slot numbers and attestation data that each validator needs to