Skip to content

Commit

Permalink
Read chain ID from environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhailUshakoff committed Aug 20, 2024
1 parent 3de0cdd commit 2147845
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Node/src/utils/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,16 @@ impl Config {
boot_nodes,
};

let taiko_chain_id = 1u64;
let taiko_chain_id = std::env::var("TAIKO_CHAIN_ID")
.expect("TAIKO_CHAIN_ID env variable must be set")
.parse::<u64>()
.map(|val| {
if val == 0 {
panic!("TAIKO_CHAIN_ID must be a positive number");
}
val
})
.expect("TAIKO_CHAIN_ID must be a number");

let config = Self {
taiko_proposer_url: std::env::var("TAIKO_PROPOSER_URL")
Expand Down

0 comments on commit 2147845

Please sign in to comment.