Skip to content

Commit 32c8852

Browse files
committed
fix.
1 parent 69c7d20 commit 32c8852

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

networks/movement/indexer-v2/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ tracing-subscriber = { workspace = true }
2828
maptos-execution-util = { workspace = true }
2929
clap = { workspace = true }
3030
reqwest = { workspace = true, features = ["json"] }
31+
movement-config = { workspace = true }
3132
serde_json = { workspace = true }
3233
tempfile = { workspace = true }
3334
processor-v2 = { workspace = true }

networks/movement/indexer-v2/src/main.rs

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use aptos_indexer_processor_sdk::server_framework::RunnableConfig;
22
use godfig::{backend::config_file::ConfigFile, Godfig};
3-
use maptos_execution_util::config::Config;
3+
use movement_config::Config;
44
use movement_health::run_service;
55
use movement_tracing::simple_metrics::start_metrics_server;
66
use processor_v2::config::indexer_processor_config::IndexerProcessorConfig;
@@ -13,25 +13,21 @@ fn main() -> Result<(), anyhow::Error> {
1313
let runtime = get_maptos_runtime();
1414

1515
runtime.block_on(async move {
16-
let maptos_config = load_maptos_config().await.expect("Failed to load maptos config");
17-
let runnable_processor_config: IndexerProcessorConfig =
18-
maptos_config.indexer_processor_v2.clone().into();
19-
16+
let config = load_maptos_config().await.expect("Failed to load maptos config");
17+
let indexer_config = config.execution_config.maptos_config.indexer_processor_v2;
18+
let runnable_processor_config: IndexerProcessorConfig = indexer_config.clone().into();
19+
let metrics_config = indexer_config.metrics_config.clone();
2020
let metrics_handle = tokio::spawn(async move {
21-
let res = start_metrics_server(
22-
maptos_config.indexer_processor_v2.metrics_config.listen_hostname,
23-
maptos_config.indexer_processor_v2.metrics_config.listen_port,
24-
)
25-
.await;
21+
let res =
22+
start_metrics_server(metrics_config.listen_hostname, metrics_config.listen_port)
23+
.await;
2624
tracing::info!("Metrics server started: {:?}", res);
2725
res
2826
});
27+
28+
let health_config = indexer_config.health_config.clone();
2929
let health_handle = tokio::spawn(async move {
30-
let res = run_service(
31-
maptos_config.indexer_processor_v2.health_config.hostname,
32-
maptos_config.indexer_processor_v2.health_config.port,
33-
)
34-
.await;
30+
let res = run_service(health_config.hostname, health_config.port).await;
3531
tracing::info!("Health server started: {:?}", res);
3632
res
3733
});
@@ -94,13 +90,12 @@ async fn load_maptos_config() -> anyhow::Result<Config> {
9490
// get the config file
9591
let dot_movement = dot_movement::DotMovement::try_from_env()?;
9692

97-
// Load Maptos config
98-
let maptos_config = {
93+
// Load config
94+
let config = {
9995
let config_file = dot_movement.try_get_or_create_config_file().await?;
100-
let godfig: Godfig<maptos_execution_util::config::Config, ConfigFile> =
101-
Godfig::new(ConfigFile::new(config_file), vec!["maptos_config".to_string()]);
96+
let godfig: Godfig<Config, ConfigFile> = Godfig::new(ConfigFile::new(config_file), vec![]);
10297
godfig.try_wait_for_ready().await
10398
}?;
10499

105-
Ok(maptos_config)
100+
Ok(config)
106101
}

0 commit comments

Comments
 (0)