diff --git a/config/stratus-follower.env.local b/config/stratus-follower.env.local deleted file mode 100644 index 83abb9e73..000000000 --- a/config/stratus-follower.env.local +++ /dev/null @@ -1,10 +0,0 @@ -RUST_LOG=info - -CHAIN_ID=2008 -EVMS=1 - -EXTERNAL_RPC=http://spec.testnet.cloudwalk.network:9934/ -EXTERNAL_RPC_WS=ws://spec.testnet.cloudwalk.network:9946/ - -PERM_STORAGE=rocks -TEMP_STORAGE=inmemory diff --git a/justfile b/justfile index b6e883218..4cc7cf598 100644 --- a/justfile +++ b/justfile @@ -91,7 +91,7 @@ stratus *args="": # Bin: Stratus main service as follower stratus-follower *args="": - LOCAL_ENV_PATH=stratus-follower cargo {{nightly_flag}} run --bin stratus {{release_flag}} --features dev -- --follower {{args}} + cargo {{nightly_flag}} run --bin stratus {{release_flag}} --features dev -- --follower --external-rpc http://spec.testnet.cloudwalk.network:9934/ --external-rpc-ws ws://spec.testnet.cloudwalk.network:9946/ {{args}} # Bin: Download external RPC blocks and receipts to temporary storage rpc-downloader *args="": diff --git a/src/config.rs b/src/config.rs index 15cac25da..86fea61e6 100644 --- a/src/config.rs +++ b/src/config.rs @@ -32,23 +32,16 @@ pub fn load_dotenv() { Ok(env) => Environment::from_str(env.as_str()), Err(_) => Ok(Environment::Local), }; - - // determine the .env file to load - let env_filename = match env { - Ok(Environment::Local) => { - // local environment only - match std::env::var("LOCAL_ENV_PATH") { - Ok(local_path) => format!("config/{}.env.local", local_path), - Err(_) => format!("config/{}.env.local", build_info::binary_name()), - } - } - Ok(env) => format!("config/{}.env.{}", build_info::binary_name(), env), + let env = match env { + Ok(env) => env, Err(e) => { println!("{e}"); return; } }; + // load .env file + let env_filename = format!("config/{}.env.{}", build_info::binary_name(), env); println!("reading env file | filename={}", env_filename); if let Err(e) = dotenvy::from_filename(env_filename) {