diff --git a/m1/Cargo.lock b/m1/Cargo.lock index 084d2fc5..3504bede 100644 --- a/m1/Cargo.lock +++ b/m1/Cargo.lock @@ -8998,8 +8998,11 @@ dependencies = [ "avalanche-types", "clap 3.2.25", "env_logger", + "log", "once_cell", "rand 0.7.3", + "random-manager", + "serde_json", "tokio", "url 2.5.0", ] diff --git a/m1/simulator/Cargo.toml b/m1/simulator/Cargo.toml index 72e459c7..3f0a1392 100644 --- a/m1/simulator/Cargo.toml +++ b/m1/simulator/Cargo.toml @@ -6,6 +6,9 @@ edition = "2021" [dependencies] avalanche-installer = "0.0.77" avalanche-network-runner-sdk = "0.3.3" # https://crates.io/crates/avalanche-network-runner-sdk +log = "0.4.19" +random-manager = "0.0.5" +serde_json = "1.0.108" # https://github.com/serde-rs/json/releases avalanche-types = { workspace = true } # https://crates.io/crates/avalanche-types aptos-sdk = {workspace = true } anyhow = { workspace = true } diff --git a/m1/simulator/src/main.rs b/m1/simulator/src/main.rs index d5a22f5a..42a4f942 100644 --- a/m1/simulator/src/main.rs +++ b/m1/simulator/src/main.rs @@ -75,29 +75,31 @@ pub enum SubCommands{ Health(HealthCommand), } -fn main() { +#[tokio::main] +async fn main() { let cli = Cli::parse(); match cli.command { - SubCommands::Start(opts) => start_network(opts), - SubCommands::Partition(opts) => partition_network(opts), - SubCommands::Reconnect(opts) => reconnect_validators(opts), - SubCommands::Health(opts) => network_health(opts), + SubCommands::Start(opts) => start_network(opts).await, + SubCommands::Partition(opts) => partition_network(opts).await, + SubCommands::Reconnect(opts) => reconnect_validators(opts).await, + SubCommands::Health(opts) => network_health(opts).await, } } -fn start_network(opts: StartCommand) { - simulator::init_m1_network() +async fn start_network(opts: StartCommand) { + simulator::init_m1_network().await; } -fn partition_network(opts: PartitionCommand) { - +async fn partition_network(opts: PartitionCommand) { + todo!() } -fn reconnect_validators(opts: ReconnectCommand) { +async fn reconnect_validators(opts: ReconnectCommand) { + todo!() } -fn network_health(opts: HealthCommand) { - +async fn network_health(opts: HealthCommand) { + todo!() } \ No newline at end of file diff --git a/m1/tests/e2e/src/tests/mod.rs b/m1/tests/e2e/src/tests/mod.rs index 930619d1..d65889ff 100644 --- a/m1/tests/e2e/src/tests/mod.rs +++ b/m1/tests/e2e/src/tests/mod.rs @@ -17,5 +17,5 @@ const AVALANCHEGO_VERSION: &str = "v1.10.9"; #[tokio::test] async fn e2e() { - init_m1_network() + init_m1_network().await }