-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also adds untested Dockerfiles for reth, lighthouse, and nimbus.
- Loading branch information
1 parent
d57fef8
commit cef63a6
Showing
21 changed files
with
217 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
#!/bin/sh | ||
|
||
geth --dev --networkid 5208 --datadir "eth-devnet" \ | ||
--http --http.api "web3,net,eth,miner" \ | ||
--http.addr 0.0.0.0 --http.port 8545 \ | ||
--http.vhosts="*" --http.corsdomain "*" | ||
~/.foundry/bin/anvil --no-mining --slots-in-an-epoch 32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use std::{path::Path}; | ||
use std::path::Path; | ||
|
||
use crate::{Network, Os, mimalloc, os, write_dockerfile}; | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use crate::Network; | ||
|
||
pub fn lighthouse(network: Network) -> (String, String, String) { | ||
assert_ne!(network, Network::Dev); | ||
|
||
#[rustfmt::skip] | ||
const DOWNLOAD_LIGHTHOUSE: &str = r#" | ||
FROM alpine:latest as lighthouse | ||
ENV LIGHTHOUSE_VERSION=5.1.3 | ||
RUN apk --no-cache add git gnupg | ||
# Download lighthouse | ||
RUN wget https://github.com/sigp/lighthouse/releases/download/v${LIGHTHOUSE_VERSION}/lighthouse-v${LIGHTHOUSE_VERSION}-$(uname -m)-unknown-linux-gnu.tar.gz | ||
RUN wget https://github.com/sigp/lighthouse/releases/download/v${LIGHTHOUSE_VERSION}/lighthouse-v${LIGHTHOUSE_VERSION}-$(uname -m)-unknown-linux-gnu.tar.gz.asc | ||
# Verify the signature | ||
gpg --keyserver keyserver.ubuntu.com --recv-keys 15E66D941F697E28F49381F426416DC3F30674B0 | ||
gpg --verify lighthouse-v${LIGHTHOUSE_VERSION}-$(uname -m)-unknown-linux-gnu.tar.gz.asc lighthouse-v${LIGHTHOUSE_VERSION}-$(uname -m)-unknown-linux-gnu.tar.gz | ||
# Extract lighthouse | ||
RUN tar xvf lighthouse-v${LIGHTHOUSE_VERSION}-$(uname -m)-unknown-linux-gnu.tar.gz | ||
"#; | ||
|
||
let run_lighthouse = format!( | ||
r#" | ||
COPY --from=lighthouse --chown=ethereum lighthouse /bin | ||
ADD /orchestration/{}/coins/ethereum/consensus/lighthouse/run.sh /consensus_layer.sh | ||
"#, | ||
network.label() | ||
); | ||
|
||
(DOWNLOAD_LIGHTHOUSE.to_string(), String::new(), run_lighthouse) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
mod lighthouse; | ||
#[allow(unused)] | ||
pub use lighthouse::lighthouse; | ||
|
||
mod nimbus; | ||
pub use nimbus::nimbus; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
use crate::Network; | ||
|
||
pub fn nimbus(network: Network) -> (String, String, String) { | ||
assert_ne!(network, Network::Dev); | ||
|
||
let platform = match std::env::consts::ARCH { | ||
"x86_64" => "amd64", | ||
"arm" => "arm32v7", | ||
"aarch64" => "arm64v8", | ||
_ => panic!("unsupported platform"), | ||
}; | ||
|
||
#[rustfmt::skip] | ||
let checksum = match platform { | ||
"amd64" => "5da10222cfb555ce2e3820ece12e8e30318945e3ed4b2b88d295963c879daeee071623c47926f880f3db89ce537fd47c6b26fe37e47aafbae3222b58bcec2fba", | ||
"arm32v7" => "7055da77bfa1186ee2e7ce2a48b923d45ccb039592f529c58d93d55a62bca46566ada451bd7497c3ae691260544f0faf303602afd85ccc18388fdfdac0bb2b45", | ||
"arm64v8" => "1a68f44598462abfade0dbeb6adf10b52614ba03605a8bf487b99493deb41468317926ef2d657479fcc26fce640aeebdbd880956beec3fb110b5abc97bd83556", | ||
_ => panic!("unsupported platform"), | ||
}; | ||
|
||
#[rustfmt::skip] | ||
let download_nimbus = format!(r#" | ||
FROM alpine:latest as nimbus | ||
ENV NIMBUS_VERSION=24.3.0 | ||
ENV NIMBUS_COMMIT=dc19b082 | ||
# Download nimbus | ||
RUN wget https://github.com/status-im/nimbus-eth2/releases/download/v${{NIMBUS_VERSION}}/nimbus-eth2_Linux_{platform}_${{NIMBUS_VERSION}}_${{NIMBUS_COMMIT}}.tar.gz | ||
# Extract nimbus | ||
RUN tar xvf nimbus-eth2_Linux_{platform}_${{NIMBUS_VERSION}}_${{NIMBUS_COMMIT}}.tar.gz | ||
RUN mv nimbus-eth2_Linux_{platform}_${{NIMBUS_VERSION}}_${{NIMBUS_COMMIT}}/build/nimbus_beacon_node ./nimbus | ||
# Verify the checksum | ||
RUN sha512sum nimbus | grep {checksum} | ||
"#); | ||
|
||
let run_nimbus = format!( | ||
r#" | ||
COPY --from=nimbus --chown=ethereum nimbus /bin | ||
ADD /orchestration/{}/coins/ethereum/consensus/nimbus/run.sh /consensus_layer.sh | ||
"#, | ||
network.label() | ||
); | ||
|
||
(download_nimbus, String::new(), run_nimbus) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use crate::Network; | ||
|
||
pub fn anvil(network: Network) -> (String, String, String) { | ||
assert_eq!(network, Network::Dev); | ||
|
||
const ANVIL_SETUP: &str = r#" | ||
RUN curl -L https://foundry.paradigm.xyz | bash || exit 0 | ||
RUN ~/.foundry/bin/foundryup | ||
EXPOSE 8545 | ||
"#; | ||
|
||
(String::new(), "RUN apt install git curl -y".to_string(), ANVIL_SETUP.to_string()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
mod reth; | ||
pub use reth::reth; | ||
|
||
mod anvil; | ||
pub use anvil::anvil; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use crate::Network; | ||
|
||
pub fn reth(network: Network) -> (String, String, String) { | ||
assert_ne!(network, Network::Dev); | ||
|
||
#[rustfmt::skip] | ||
const DOWNLOAD_RETH: &str = r#" | ||
FROM alpine:latest as reth | ||
ENV RETH_VERSION=0.2.0-beta.6 | ||
RUN apk --no-cache add git gnupg | ||
# Download reth | ||
RUN wget https://github.com/paradigmxyz/reth/releases/download/v${RETH_VERSION}/reth-v${RETH_VERSION}-$(uname -m)-unknown-linux-gnu.tar.gz | ||
RUN wget https://github.com/paradigmxyz/reth/releases/download/v${RETH_VERSION}/reth-v${RETH_VERSION}-$(uname -m)-unknown-linux-gnu.tar.gz.asc | ||
# Verify the signature | ||
gpg --keyserver keyserver.ubuntu.com --recv-keys A3AE097C89093A124049DF1F5391A3C4100530B4 | ||
gpg --verify reth-v${RETH_VERSION}-$(uname -m).tar.gz.asc reth-v${RETH_VERSION}-$(uname -m)-unknown-linux-gnu.tar.gz | ||
# Extract reth | ||
RUN tar xvf reth-v${RETH_VERSION}-$(uname -m)-unknown-linux-gnu.tar.gz | ||
"#; | ||
|
||
let run_reth = format!( | ||
r#" | ||
COPY --from=reth --chown=ethereum reth /bin | ||
EXPOSE 30303 9001 8545 | ||
ADD /orchestration/{}/coins/ethereum/execution/reth/run.sh /execution_layer.sh | ||
"#, | ||
network.label() | ||
); | ||
|
||
(DOWNLOAD_RETH.to_string(), String::new(), run_reth) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/{}/coins/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("coins"); | ||
ethereum_path.push("ethereum"); | ||
ethereum_path.push("Dockerfile"); | ||
|
||
write_dockerfile(ethereum_path, &res); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use std::{path::Path}; | ||
use std::path::Path; | ||
|
||
use crate::{Network, Os, mimalloc, write_dockerfile}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use std::{path::Path}; | ||
use std::path::Path; | ||
|
||
use zeroize::Zeroizing; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use std::{path::Path}; | ||
use std::path::Path; | ||
|
||
use ciphersuite::{group::GroupEncoding, Ciphersuite, Ristretto}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use std::{path::Path}; | ||
use std::path::Path; | ||
|
||
use zeroize::Zeroizing; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
orchestration/testnet/coins/ethereum/consensus/lighthouse/run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
RUST_LOG=info lighthouse bn --execution-endpoint http://localhost:8551 --execution-jwt /home/ethereum/.jwt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
#geth --dev --networkid 5208 \ | ||
# --http --http.api "web3,net,eth,miner" \ | ||
# --http.addr 0.0.0.0 --http.port 8545 \ | ||
# --http.vhosts="*" --http.corsdomain "*" | ||
|
||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
RUST_LOG=info reth node --authrpc.jwtsecret /home/ethereum/.jwt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
#!/bin/sh | ||
|
||
exit 1 | ||
/execution_layer.sh & /consensus_layer.sh |