Skip to content

Commit

Permalink
chore!: change target path where to copy network contacts file for cl…
Browse files Browse the repository at this point in the history
…ients to ~/.safe/network_contacts
  • Loading branch information
bochaco authored and joshuef committed Aug 16, 2022
1 parent 7d78e0e commit 45fd3d8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lib.rs
Expand Up @@ -114,7 +114,7 @@ impl Launch {
debug!("Genesis wait over...");
}

let genesis_contacts_filepath = self.nodes_dir.join("sn-node-genesis").join("prefix_map");
let genesis_contacts_filepath = self.nodes_dir.join("sn-node-genesis").join("section_tree");

let node_ids = self.node_ids()?;
if !node_ids.is_empty() {
Expand All @@ -133,20 +133,20 @@ impl Launch {
}
}

// Let's copy the genesis' prefix map file to the default location for clients to use
let client_prefixmap_dir = dirs_next::home_dir()
// Let's copy the genesis' section_tree file to the default location for clients to use
let client_network_contacts_dir = dirs_next::home_dir()
.ok_or_else(|| eyre!("Could not read user's home directory".to_string()))?
.join(".safe")
.join("prefix_maps");
.join("network_contacts");

info!(
"Copying network contacts file to {} for local clients to bootstrap to the network",
client_prefixmap_dir.display()
client_network_contacts_dir.display()
);
fs::create_dir_all(&client_prefixmap_dir)?;
fs::create_dir_all(&client_network_contacts_dir)?;
fs::copy(
genesis_contacts_filepath,
client_prefixmap_dir.join("default"),
client_network_contacts_dir.join("default"),
)?;

info!("Done!");
Expand Down

0 comments on commit 45fd3d8

Please sign in to comment.