Skip to content

Commit

Permalink
[CLI] Fix faucet component of local testnet without --force-restart
Browse files Browse the repository at this point in the history
  • Loading branch information
banool committed Sep 25, 2023
1 parent 9aa41b0 commit 259ddaf
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions crates/aptos/src/node/local_testnet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,28 @@ impl RunLocalTestnet {
.map(StdRng::from_seed)
.unwrap_or_else(StdRng::from_entropy);

let mut node_config = create_single_node_test_config(
&self.config_path,
&self.test_config_override,
&test_dir,
false,
false,
aptos_cached_packages::head_release_bundle(),
rng,
)
.context("Failed to create config for node")?;
let validator_config_path = test_dir.join("0").join("node.yaml");
let mut node_config = match validator_config_path.exists() {
// Start with the existing config if present.
true => NodeConfig::load_from_path(&validator_config_path).with_context(|| {
format!(
"Failed to load existing config at {}, try using --force-restart",
validator_config_path.display()
)
})?,
// Create a new one if not, e.g. if this is the first run or the user
// specified --force-restart.
false => create_single_node_test_config(
&self.config_path,
&self.test_config_override,
&test_dir,
false,
false,
aptos_cached_packages::head_release_bundle(),
rng,
)
.context("Failed to create config for node")?,
};

eprintln!();

Expand Down

0 comments on commit 259ddaf

Please sign in to comment.