Skip to content
Open
Changes from all 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
6 changes: 5 additions & 1 deletion examples/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::{path::PathBuf, str::FromStr};

use alloy::eips::BlockNumberOrTag;
use alloy::primitives::{utils::format_ether, Address};
use dotenv::dotenv;
use eyre::Result;
use tracing::info;
use tracing_subscriber::filter::{EnvFilter, LevelFilter};
Expand All @@ -22,7 +23,10 @@ async fn main() -> Result<()> {

tracing::subscriber::set_global_default(subscriber).expect("subscriber set failed");

let untrusted_rpc_url = "https://eth-mainnet.g.alchemy.com/v2/<YOUR_API_KEY>";
// Load the RPC URL using environment variable for security
dotenv().ok();
let untrusted_rpc_url = std::env::var("MAINNET_EXECUTION_RPC")
.expect("MAINNET_EXECUTION_RPC environment variable not set");
info!("Using untrusted RPC URL [REDACTED]");

let consensus_rpc = "https://www.lightclientdata.org";
Expand Down