sui_bridge_indexer/
config.rs1use serde::{Deserialize, Serialize};
5use std::env;
6
7#[derive(Debug, Clone, Deserialize, Serialize)]
9pub struct IndexerConfig {
10 pub remote_store_url: String,
11 pub checkpoints_path: Option<String>,
13
14 pub sui_rpc_url: String,
15 pub eth_rpc_url: String,
16 pub eth_ws_url: String,
17
18 #[serde(default = "default_db_url")]
19 pub db_url: String,
20 pub concurrency: u64,
21 pub sui_bridge_genesis_checkpoint: u64,
23 pub eth_bridge_genesis_block: u64,
25 pub eth_sui_bridge_contract_address: String,
26
27 pub metric_port: u16,
28
29 #[serde(default)]
30 pub eth_only: bool,
31}
32
33impl sui_config::Config for IndexerConfig {}
34
35pub fn default_db_url() -> String {
36 env::var("DB_URL").expect("db_url must be set in config or via the $DB_URL env var")
37}