Skip to content

Commit

Permalink
Merge pull request #122 from propeller-heads/zz/make-RPC-URL-obvious
Browse files Browse the repository at this point in the history
refactor(example): early error if `RPC_URL` isn't set in `price_printer`
  • Loading branch information
zizou0x authored Jan 7, 2025
2 parents 1b510fe + 6059e13 commit 6878a66
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/price_printer/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ async fn main() {
let tycho_api_key: String =
env::var("TYCHO_API_KEY").unwrap_or_else(|_| "sampletoken".to_string());

// Perform an early check to ensure `RPC_URL` is set.
// This prevents errors from occurring later during UI interactions.
// Can be commented out if only using the example with uniswap_v2 and uniswap_v3.
env::var("RPC_URL").expect("RPC_URL env variable should be set");

// Create communication channels for inter-thread communication
let (tick_tx, tick_rx) = mpsc::channel::<BlockUpdate>(12);

Expand Down

0 comments on commit 6878a66

Please sign in to comment.