diff --git a/indexer/.env.example b/indexer/.env.example index 139a3b59c..07bbbfe1f 100644 --- a/indexer/.env.example +++ b/indexer/.env.example @@ -7,7 +7,8 @@ INDEXER_OPTIMISM_ENABLED=true INDEXER_ETHEREUM_START_BLOCK=0 INDEXER_OPTIMISM_START_BLOCK=0 -STAKING_CONTRACT_ADDRESS=0x0000000000000000000000000000000000000000 +STAKING_CONTRACT_ADDRESS_ETH_MAINNET=0x0000000000000000000000000000000000000000 +STAKING_CONTRACT_ADDRESS_OP_MAINNET=0x0000000000000000000000000000000000000000 DB_USER=user DB_PASSWORD=pw diff --git a/indexer/src/main.rs b/indexer/src/main.rs index 482fbe7b8..2b7f2a989 100644 --- a/indexer/src/main.rs +++ b/indexer/src/main.rs @@ -21,14 +21,17 @@ async fn main() -> Result<()> { loop { let postgres_client = PostgresClient::new().await?; - let contract_address = get_env("STAKING_CONTRACT_ADDRESS") + let contract_address_eth_mainnet = get_env("STAKING_CONTRACT_ADDRESS_ETH_MAINNET") + .parse::
() + .unwrap(); + let contract_address_op_mainnet = get_env("STAKING_CONTRACT_ADDRESS_OP_MAINNET") .parse::() .unwrap(); match try_join!( run_legacy_indexer(postgres_client.clone()), - run_ethereum_indexer(postgres_client.clone(), &contract_address), - run_optimism_indexer(postgres_client.clone(), &contract_address) + run_ethereum_indexer(postgres_client.clone(), &contract_address_eth_mainnet), + run_optimism_indexer(postgres_client.clone(), &contract_address_op_mainnet) ) { Ok(_) => { eprintln!("Warning - top-level join ended without error");