Skip to content

Commit

Permalink
fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
chinyuchan committed Mar 18, 2024
1 parent 4639db8 commit 5025693
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions indexer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use log::info;
use serde::{Deserialize, Serialize};
use sqlx::pool::PoolOptions;
use sqlx::{PgPool, Pool, Postgres};
use std::env;
use std::fs::File;
use std::io::Read;
use std::sync::Arc;
Expand Down Expand Up @@ -57,7 +56,7 @@ async fn main() -> Result<()> {
tracing_subscriber::fmt::init();

let config = Config::new("./config.toml")?;
info!("listen at: {}", config.listen);
info!("listening at: {}", config.listen);
info!("EVM RPC: {}", config.evm_rpc);
info!("staking contract: {}", config.staking);
info!("reward contract: {}", config.reward);
Expand All @@ -68,10 +67,9 @@ async fn main() -> Result<()> {
let reward_addr: Address = config.reward.parse()?;
let reward = RewardContract::new(reward_addr, Arc::new(provider));

let db_url = env::var("DATABASE_URL").expect("missing env var `DATABASE_URL`");
let pool: Pool<Postgres> = PoolOptions::new()
.max_connections(10)
.connect(db_url.as_str())
.connect(&config.db_url)
.await
.expect("can't connect to database");
info!("Connecting db...ok");
Expand Down
2 changes: 1 addition & 1 deletion scanner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ async fn main() -> Result<()> {

let rpc_url: Url = args.node.parse().expect("parse node url");

info!("Start syncing...");
info!("Starting syncing...");
let scanner = Scanner::new(DEFAULT_RPC_RETRIES, num_cpus::get(), rpc_url, storage)
.expect("failed to new scanner");
let _ = scanner.run(start, interval).await;
Expand Down

0 comments on commit 5025693

Please sign in to comment.