Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(l1): add Mekong presets #1862

Merged
merged 5 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmd/ethrex/ethrex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ async fn main() {
bootnodes = networks::SEPOLIA_BOOTNODES.to_vec();
}

if network == "mekong" {
warn!("Using mekong presets, bootnodes field will be ignored");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of ignoring the bootnodes field, shouldn't we append it? Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, we should add that logic to the other networks too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Set mekong presets
network = String::from(networks::MEKONG_GENESIS_PATH);
bootnodes = networks::MEKONG_BOOTNODES.to_vec();
}

if bootnodes.is_empty() {
warn!("No bootnodes specified. This node will not be able to connect to the network.");
}
Expand Down
6 changes: 6 additions & 0 deletions cmd/ethrex/networks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ use lazy_static::lazy_static;

pub const HOLESKY_GENESIS_PATH: &str = "cmd/ethrex/networks/holesky/genesis.json";
pub const SEPOLIA_GENESIS_PATH: &str = "cmd/ethrex/networks/sepolia/genesis.json";
pub const MEKONG_GENESIS_PATH: &str = "cmd/ethrex/networks/mekong/genesis.json";

pub const HOLESKY_BOOTNODES_PATH: &str = "cmd/ethrex/networks/holesky/bootnodes.json";
pub const SEPOLIA_BOOTNODES_PATH: &str = "cmd/ethrex/networks/sepolia/bootnodes.json";
pub const MEKONG_BOOTNODES_PATH: &str = "cmd/ethrex/networks/mekong/bootnodes.json";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where are these files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to push them, should be up now


lazy_static! {
pub static ref HOLESKY_BOOTNODES: Vec<Node> = serde_json::from_reader(
Expand All @@ -16,4 +18,8 @@ lazy_static! {
std::fs::File::open(SEPOLIA_BOOTNODES_PATH).expect("Failed to open sepolia bootnodes file")
)
.expect("Failed to parse sepolia bootnodes file");
pub static ref MEKONG_BOOTNODES: Vec<BootNode> = serde_json::from_reader(
std::fs::File::open(MEKONG_BOOTNODES_PATH).expect("Failed to open mekong bootnodes file")
)
.expect("Failed to parse mekong bootnodes file");
}
22 changes: 22 additions & 0 deletions cmd/ethrex/networks/mekong/bootnodes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
"enode://ef176123d2d60a8e9b6e6071ffa025ed361ab5bacfcbecfce77768d4d46b427ca61834bfc9bedb37d1a773c0eba5443139864da42c40a3ecf8bb6f6c76c0486e@67.205.162.17:30303",
"enode://71222cf282353776342440179c317620bd9d2b8646c75fd2c59a65eae234fd18d9ebbe39399507e1c6d9098a087502b2f1cea88c4a01dda2503c7a4b87494419@167.99.0.12:30303",
"enode://681ccf623278e61402d8ebefd3d4fd819035b306a8640499dd33e426e0fabf3e299db65967a82323df86cd42719b1379f4bf6013f8abf6611e45aa46961e4483@161.35.59.75:30303",
"enode://ce36d601154e6d7c5c7f9164d690006fed2c5d0e03de2912685d14328f383e9ea14e4c0ad63c52579ed2f77bbba3860b29d38327194e9e55d69b7f4512462183@142.93.254.25:30303",
"enode://f044edd2e778e8a21ee4828799971f689aa524d551d3260c7ce2d4186e8a9143d3ddc47435e78b9979199bc82d0faff80b5692900502037082233593a2be05ef@178.128.80.190:30303",
"enode://3c5dffef67a62e1620bcb76e0eda55a7d50af8ae59e08be0f51ecd5de240437f851e17c2a2f6978136a7573b67ca2a306259358b0130d198b280f3db6544de16@143.110.169.245:30303",
"enode://432e23f7159166458286196a7f458e3c8c90e86e8a0fb65d9591f31650aafa8e6949ecae508381ad75147eb3ca7a115da0c441d4ce2c68fb4c4517fac6f3a5ab@138.197.104.81:30303",
"enode://edf3094c9180ba78e10ef1cbfc5fa9580378339582baebf04dbf2aee13c29ccbfb5266664558db91f61908d18f23cc1b5e415838412401672dc63599718861b4@167.99.39.60:30303",
"enode://5b86fa8ddcdeae773469931912e59cafe061d3275adff37f57c725387c4df756d24c20e97d7c4c74c84b701f55c22d428a750b2ba6aab5a90aeb1b5b6d677e9d@137.184.28.133:30303",
"enode://1867128ddb268dbd75cd8cbf9f7728f6cace5b7684c8ed088745cd73697e549113dc3167f49ca7eb468d851f3be7ee47d7c9691dafa18f6896b666e0951745df@188.166.253.225:30303",
"enode://e772211d6530044a22a0ea422e3eb5272ebf80e218aa043b6d744050e27db9bbbbb8ed6f5e7c4511a93e0e7333cb600c3dcc50c606d4e32d321adc62c0b1ca9a@144.126.203.231:30303",
"enode://3501eed98a232e90a9ea576b2cf93edb933c741f394adc0950273c6c536a3f44a42ebb0e3a74de41c1b3e17bc8048e82f70993fa03968170ad0f1d24e7e4c560@167.99.6.211:30303",
"enode://6c61e995aa060a46213e7cf5ad62ab501a561f8c0abf3a90fe981f3a34056e66ce4d96392d08f3f5c9d1dc4f11e331c2220139c938ed2414dbb956f47333ae93@24.144.122.15:30303",
"enode://6915ee73a7849463edcf23ed70805452bf55ee0f9cd7e1743aebcc2e6145e84c1744b86c4dd59c11f6d428a7a0967665eaa18ad9f2578d7ecd2f5356f6bbe1d3@67.205.167.220:30303",
"enode://499e59ff79f4d72385ece9f1d1f940b44055c9c98c9ccb15b3386671f05bb1edcbf55c42278475f7662e9f4b7fd47560d50742e1f00030140b7672ed7112747b@178.128.81.140:30303",
"enode://030d7a424109a94d00a2ec6ac21a3cca906c399db11801877f5da92415a8e095390049a51cf6ec4139a24a8533994d2d83a0ca3958d36e8acd3ba5c7ce393aa3@24.144.98.251:30303",
"enode://1d596ee2ca090d242a6bfe1cd48d0ca3a6cdccc27ab56d15714ba79b6d82b0304d6a4d4331934ce0aa1ea3e688873026b38908db273c9eade1504a6f535591e6@152.42.236.207:30303",
"enode://826f3a5cbb987a74df5ccd1a9cf05d28840667360aa7b42afd908eb9e5c6e0528f053ef7c3e09ebd84142c49650e317f772bab3ac4a5a3045f27df33a470d244@165.227.90.54:30303",
"enode://52d4c61afd1d9b93e70acefd17cfabaed27e8be309927b2e9ecd648cb7edc09ef5c7f4aa579a00c5545e4ef2305e4df8600b8f829e80c056f9805860116d3168@137.184.72.127:30303",
"enode://09190ab57a83381432a6a8053e5d06e122e1b3fb52f75150901abdef18bf06651482dea0232121387971318ac341995d729c12a56f4b5c3d7198dc6b4c981fe6@209.38.29.180:30303"
]
Loading
Loading