A first go at persisting validator keys and handling configuration. Addresses issue #253.

- Creates a keystore directory in the config
 - Fetches serialized keys from the keystore directory
 - If no keys, generates keys randomly, saves serialized keys to keystore dir.
This commit is contained in:
Luke Anderson
2019-03-12 21:56:45 +11:00
parent b2926b4ed0
commit e942d7533b
4 changed files with 73 additions and 9 deletions

View File

@@ -14,4 +14,8 @@ impl Keypair {
let pk = PublicKey::from_secret_key(&sk);
Keypair { sk, pk }
}
pub fn identifier(&self) -> String {
self.pk.concatenated_hex_id()
}
}