Add topics to chain id

This commit is contained in:
Age Manning
2019-04-03 12:25:05 +11:00
parent c7bd02caaf
commit 4e24c8e651
3 changed files with 26 additions and 5 deletions

View File

@@ -18,6 +18,21 @@ pub struct ClientConfig {
impl Default for ClientConfig {
fn default() -> Self {
let data_dir = {
let home = dirs::home_dir().expect("Unable to determine home dir.");
home.join(".lighthouse/")
};
fs::create_dir_all(&data_dir)
.unwrap_or_else(|_| panic!("Unable to create {:?}", &data_dir));
let default_spec = ChainSpec::lighthouse_testnet();
let default_pubsub_topics = vec![
default_spec.beacon_chain_topic.clone(),
default_spec.shard_topic_prefix.clone(),
]; // simple singular attestation topic for now.
let default_net_conf =
NetworkConfig::new(default_spec.boot_nodes.clone(), default_pubsub_topics);
Self {
data_dir: PathBuf::from(".lighthouse"),
db_type: "disk".to_string(),