Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(indexer): index staking contract on eth mainnet on deployed to d… #580

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion indexer/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions indexer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Address>()
.unwrap();
let contract_address_op_mainnet = get_env("STAKING_CONTRACT_ADDRESS_OP_MAINNET")
.parse::<Address>()
.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");
Expand Down
Loading