Skip to content

Commit

Permalink
Better error message when a sui config folder exists without genesis …
Browse files Browse the repository at this point in the history
…metadata
  • Loading branch information
stefan-mysten committed Sep 21, 2024
1 parent 5efd2c4 commit 3c72145
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/sui/src/sui_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ async fn start(
swarm_builder = swarm_builder.with_epoch_duration_ms(epoch_duration_ms);
} else {
if config.is_none() && !sui_config_dir()?.join(SUI_NETWORK_CONFIG).exists() {
genesis(None, None, None, false, epoch_duration_ms, None, false).await?;
genesis(None, None, None, false, epoch_duration_ms, None, false).await.map_err(|_| anyhow!("Cannot run genesis with non-empty Sui config directory: {}.\n\nIf you are trying to run a local network without persisting the data (so a new genesis that is randomly generated and will not be saved once the network is shut down), use --force-regenesis flag.\nIf you are trying to persist the network data and start from a new genesis, use sui genesis --help to see how to generate a new genesis.", sui_config_dir().unwrap().display()))?;
}

// Load the config of the Sui authority.
Expand Down

0 comments on commit 3c72145

Please sign in to comment.