From f9a82b062b325a9845842831e9d6a85275002633 Mon Sep 17 00:00:00 2001 From: Andreas Bigger Date: Wed, 11 Oct 2023 10:24:59 -0400 Subject: [PATCH] fixes --- crates/stages/src/lib.rs | 1 + crates/stages/src/stages/batcher.rs | 12 ++++++++---- crates/stages/src/stages/challenger.rs | 14 +++++++++----- crates/stages/src/stages/layer_two.rs | 2 +- crates/stages/src/stages/proposer.rs | 12 ++++++++---- crates/stages/src/stages/rollup.rs | 2 +- crates/stages/src/stages/stateviz.rs | 12 ++++++++---- 7 files changed, 36 insertions(+), 19 deletions(-) diff --git a/crates/stages/src/lib.rs b/crates/stages/src/lib.rs index 2378085..7446725 100644 --- a/crates/stages/src/lib.rs +++ b/crates/stages/src/lib.rs @@ -22,3 +22,4 @@ pub trait Stage { /// Core Stages. pub mod stages; +pub use stages::Stages; diff --git a/crates/stages/src/stages/batcher.rs b/crates/stages/src/stages/batcher.rs index 341f11f..3be2884 100644 --- a/crates/stages/src/stages/batcher.rs +++ b/crates/stages/src/stages/batcher.rs @@ -27,10 +27,14 @@ impl crate::Stage for Batcher { .flatten() .ok_or(eyre::eyre!("missing dockerfile directory"))?; - let addresses = self - .addresses - .as_ref() - .ok_or(eyre::eyre!("missing addresses"))?; + // let addresses = self + // .addresses + // .as_ref() + // .ok_or(eyre::eyre!("missing addresses"))?; + + let proj_root = project_root::get_project_root()?; + let addresses_json_file = proj_root.as_path().join(".devnet").join("addresses.json"); + let addresses = crate::json::read_json(&addresses_json_file)?; let genesis_rollup_file = self .genesis_rollup_file diff --git a/crates/stages/src/stages/challenger.rs b/crates/stages/src/stages/challenger.rs index 6f3cba4..edf1ef0 100644 --- a/crates/stages/src/stages/challenger.rs +++ b/crates/stages/src/stages/challenger.rs @@ -27,17 +27,21 @@ impl crate::Stage for Challenger { .flatten() .ok_or(eyre::eyre!("challenger stage missing dockerfile directory"))?; - let addresses = self - .addresses - .as_ref() - .ok_or(eyre::eyre!("challenger stage missing addresses"))?; + // let addresses = self + // .addresses + // .as_ref() + // .ok_or(eyre::eyre!("challenger stage missing addresses"))?; + + let proj_root = project_root::get_project_root()?; + let addresses_json_file = proj_root.as_path().join(".devnet").join("addresses.json"); + let addresses = crate::json::read_json(&addresses_json_file)?; let start_challenger = Command::new("docker-compose") .args(["up", "-d", "--no-deps", "--build", "challenger"]) .env("PWD", docker_dir) .env("L2OO_ADDRESS", addresses["L2OutputOracleProxy"].to_string()) .env("DGF_ADDRESS", addresses["DisputeGameFactory"].to_string()) - .env("CHALLENGER_AGENT_CHOICE", self.challenger) + .env("CHALLENGER_AGENT_CHOICE", &self.challenger) .current_dir(&docker_dir) .output()?; diff --git a/crates/stages/src/stages/layer_two.rs b/crates/stages/src/stages/layer_two.rs index cc0f1ae..371c0cb 100644 --- a/crates/stages/src/stages/layer_two.rs +++ b/crates/stages/src/stages/layer_two.rs @@ -35,7 +35,7 @@ impl crate::Stage for LayerTwo { let start_l2 = Command::new("docker-compose") .args(["up", "-d", "--no-deps", "--build", "l2"]) .env("PWD", docker_dir) - .env("L2_CLIENT_CHOICE", self.l2_client) + .env("L2_CLIENT_CHOICE", &self.l2_client) .current_dir(&docker_dir) .output()?; diff --git a/crates/stages/src/stages/proposer.rs b/crates/stages/src/stages/proposer.rs index 466b64d..b02fee5 100644 --- a/crates/stages/src/stages/proposer.rs +++ b/crates/stages/src/stages/proposer.rs @@ -25,10 +25,14 @@ impl crate::Stage for Proposer { .flatten() .ok_or(eyre::eyre!("missing dockerfile directory"))?; - let addresses = self - .addresses - .as_ref() - .ok_or(eyre::eyre!("missing addresses"))?; + // let addresses = self + // .addresses + // .as_ref() + // .ok_or(eyre::eyre!("missing addresses"))?; + + let proj_root = project_root::get_project_root()?; + let addresses_json_file = proj_root.as_path().join(".devnet").join("addresses.json"); + let addresses = crate::json::read_json(&addresses_json_file)?; let start_proposer = Command::new("docker-compose") .args(["up", "-d", "--no-deps", "--build", "proposer"]) diff --git a/crates/stages/src/stages/rollup.rs b/crates/stages/src/stages/rollup.rs index 8c28456..3ad1fa4 100644 --- a/crates/stages/src/stages/rollup.rs +++ b/crates/stages/src/stages/rollup.rs @@ -35,7 +35,7 @@ impl crate::Stage for Rollup { let start_rollup = Command::new("docker-compose") .args(["up", "-d", "--no-deps", "--build", "rollup-client"]) .env("PWD", docker_dir) - .env("ROLLUP_CLIENT_CHOICE", self.rollup_client) + .env("ROLLUP_CLIENT_CHOICE", &self.rollup_client) .current_dir(&docker_dir) .output()?; diff --git a/crates/stages/src/stages/stateviz.rs b/crates/stages/src/stages/stateviz.rs index a6fd625..110d4b9 100644 --- a/crates/stages/src/stages/stateviz.rs +++ b/crates/stages/src/stages/stateviz.rs @@ -25,10 +25,14 @@ impl crate::Stage for Stateviz { .flatten() .ok_or(eyre::eyre!("stateviz stage missing dockerfile directory"))?; - let addresses = self - .addresses - .as_ref() - .ok_or(eyre::eyre!("stateviz stage missing addresses"))?; + // let addresses = self + // .addresses + // .as_ref() + // .ok_or(eyre::eyre!("stateviz stage missing addresses"))?; + + let proj_root = project_root::get_project_root()?; + let addresses_json_file = proj_root.as_path().join(".devnet").join("addresses.json"); + let addresses = crate::json::read_json(&addresses_json_file)?; let start_stateviz = Command::new("docker-compose") .args(["up", "-d", "--no-deps", "--build", "stateviz"])