Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pompon0 committed Apr 3, 2024
1 parent 2ccd349 commit 1ab24f8
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions node/tools/src/bin/localnet_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use std::{
net::{Ipv4Addr, SocketAddr},
path::PathBuf,
};
use zksync_consensus_crypto::TextFmt;
use zksync_consensus_roles::{node, validator};
use zksync_consensus_tools::{encode_json, AppConfig};
use zksync_protobuf::serde::Serde;
Expand Down Expand Up @@ -101,18 +100,12 @@ fn main() -> anyhow::Result<()> {
}
}

for (i, cfg) in cfgs.into_iter().enumerate() {
for cfg in cfgs {
// Recreate the directory for the node's config.
let root = args.output_dir.join(&cfg.public_addr.0);
let _ = fs::remove_dir_all(&root);
fs::create_dir_all(&root).with_context(|| format!("create_dir_all({:?})", root))?;
fs::write(root.join("config.json"), encode_json(&Serde(cfg))).context("fs::write()")?;
fs::write(
root.join("validator_key"),
&TextFmt::encode(&validator_keys[i]),
)
.context("fs::write()")?;
fs::write(root.join("node_key"), &TextFmt::encode(&node_keys[i])).context("fs::write()")?;
}
Ok(())
}

0 comments on commit 1ab24f8

Please sign in to comment.