Writing pem and config file during node init

This commit is contained in:
Dave Hrycyszyn
2024-06-06 15:29:22 +01:00
parent db0a6a0725
commit 91293296fb
4 changed files with 116 additions and 25 deletions

View File

@@ -11,8 +11,7 @@ async fn main() {
match &args.command {
Some(Commands::Init {}) => {
let home = std::env::var("HOME").expect("couldn't read home directory env variable");
let _ = init::init(home);
let _ = init::init(home());
}
Some(Commands::Run {}) => {
let (mut bft_crdt, keys) = list_transaction_crdt::new();
@@ -21,3 +20,9 @@ async fn main() {
None => println!("No command provided. Exiting. See --help for more information."),
}
}
fn home() -> std::path::PathBuf {
let mut path = dirs::home_dir().unwrap();
path.push(".side");
path
}