Rename the coins folder to networks (#583)

* Rename the coins folder to networks

Ethereum isn't a coin. It's a network.

Resolves #357.

* More renames of coins -> networks in orchestration

* Correct paths in tests/

* cargo fmt
This commit is contained in:
Luke Parker
2024-07-18 12:16:45 -07:00
committed by GitHub
parent 40cc180853
commit 7d2d739042
244 changed files with 102 additions and 99 deletions

View File

@@ -0,0 +1,43 @@
use std::path::Path;
use crate::{Network, Os, mimalloc, os, write_dockerfile};
mod execution;
use execution::*;
mod consensus;
use consensus::*;
pub fn ethereum(orchestration_path: &Path, network: Network) {
let ((el_download, el_run_as_root, el_run), (cl_download, cl_run_as_root, cl_run)) =
if network == Network::Dev {
(anvil(network), (String::new(), String::new(), String::new()))
} else {
// TODO: Select an EL/CL based off a RNG seeded from the public key
(reth(network), nimbus(network))
};
let download = mimalloc(Os::Alpine).to_string() + &el_download + &cl_download;
let run = format!(
r#"
ADD /orchestration/{}/networks/ethereum/run.sh /run.sh
CMD ["/run.sh"]
"#,
network.label()
);
let run = mimalloc(Os::Debian).to_string() +
&os(Os::Debian, &(el_run_as_root + "\r\n" + &cl_run_as_root), "ethereum") +
&el_run +
&cl_run +
&run;
let res = download + &run;
let mut ethereum_path = orchestration_path.to_path_buf();
ethereum_path.push("networks");
ethereum_path.push("ethereum");
ethereum_path.push("Dockerfile");
write_dockerfile(ethereum_path, &res);
}