Bitcoin keys now being produced per-node

This commit is contained in:
Dave Hrycyszyn
2024-06-18 16:32:32 +01:00
parent 4cf6513959
commit f5da5af0b9
8 changed files with 66 additions and 22 deletions

View File

@@ -3,18 +3,22 @@ use std::path::PathBuf;
use bft_json_crdt::json_crdt::SignedOp;
use serde_json::{json, Value};
pub(crate) const BITCOIN_KEY_FILE: &str = "bitcoin_keys.pem";
pub(crate) const BFT_CRDT_KEY_FILE: &str = "keys.pem";
pub(crate) const CONFIG_FILE: &str = "config.toml";
/// Returns the path to the key file and config for this host OS.
pub(crate) fn side_paths(prefix: PathBuf) -> (PathBuf, PathBuf) {
let mut key_path = prefix.clone();
key_path.push(BFT_CRDT_KEY_FILE);
pub(crate) fn side_paths(prefix: PathBuf) -> (PathBuf, PathBuf, PathBuf) {
let mut bft_crdt_key_path = prefix.clone();
bft_crdt_key_path.push(BFT_CRDT_KEY_FILE);
let mut bitcoin_key_path = prefix.clone();
bitcoin_key_path.push(BITCOIN_KEY_FILE);
let mut config_path = prefix.clone();
config_path.push(CONFIG_FILE);
(key_path, config_path)
(bft_crdt_key_path, bitcoin_key_path, config_path)
}
pub(crate) fn home(name: &String) -> std::path::PathBuf {