Revert "Merge pull request #200 from sigp/new-structure"

This reverts commit d7a3545be1, reversing
changes made to 1da06c156c.
This commit is contained in:
Paul Hauner
2019-02-14 12:09:18 +11:00
parent d7a3545be1
commit 35c914baa6
163 changed files with 15510 additions and 137 deletions

View File

@@ -0,0 +1,25 @@
use std::fs;
use std::path::PathBuf;
/// Stores the core configuration for this validator instance.
#[derive(Clone)]
pub struct ClientConfig {
pub data_dir: PathBuf,
pub server: String,
}
const DEFAULT_LIGHTHOUSE_DIR: &str = ".lighthouse-validators";
impl ClientConfig {
/// Build a new configuration from defaults.
pub fn default() -> Self {
let data_dir = {
let home = dirs::home_dir().expect("Unable to determine home dir.");
home.join(DEFAULT_LIGHTHOUSE_DIR)
};
fs::create_dir_all(&data_dir)
.unwrap_or_else(|_| panic!("Unable to create {:?}", &data_dir));
let server = "localhost:50051".to_string();
Self { data_dir, server }
}
}