Skip to content

Commit

Permalink
fix(example/call): read local env variables via dotenv
Browse files Browse the repository at this point in the history
  • Loading branch information
hsyodyssey committed Dec 8, 2023
1 parent b0ddc2c commit 42605f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::path::PathBuf;
use tracing::info;
use tracing_subscriber::filter::{EnvFilter, LevelFilter};
use tracing_subscriber::FmtSubscriber;
use dotenv::dotenv;

use helios::{
client::{Client, ClientBuilder, FileDB},
Expand All @@ -26,6 +27,7 @@ async fn main() -> eyre::Result<()> {
tracing::subscriber::set_global_default(subscriber).expect("subsriber set failed");

// Load the rpc url using the `MAINNET_EXECUTION_RPC` environment variable
dotenv().ok();
let eth_rpc_url = std::env::var("MAINNET_EXECUTION_RPC")?;
let consensus_rpc = "https://www.lightclientdata.org";
info!("Consensus RPC URL: {}", consensus_rpc);
Expand Down

0 comments on commit 42605f4

Please sign in to comment.