From db4d587f185f1a40e4888dd94b5393e70db5c500 Mon Sep 17 00:00:00 2001 From: akhercha Date: Tue, 27 Aug 2024 22:52:15 +0200 Subject: [PATCH] =?UTF-8?q?feat(theoros=5Fremove=5Fdb):=20Last=20nit=20?= =?UTF-8?q?=F0=9F=92=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rust/pragma-cli/Cargo.toml | 1 - rust/theoros/src/main.rs | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rust/pragma-cli/Cargo.toml b/rust/pragma-cli/Cargo.toml index 4245c379..62e5221a 100644 --- a/rust/pragma-cli/Cargo.toml +++ b/rust/pragma-cli/Cargo.toml @@ -13,7 +13,6 @@ bollard = { workspace = true } clap = { workspace = true } dirs = { workspace = true } env_logger = { workspace = true } -# TODO: alloy alloy = { workspace = true } eyre = { workspace = true } futures-util = { workspace = true } diff --git a/rust/theoros/src/main.rs b/rust/theoros/src/main.rs index 79166626..7d31e780 100644 --- a/rust/theoros/src/main.rs +++ b/rust/theoros/src/main.rs @@ -44,15 +44,18 @@ async fn main() -> Result<()> { let metrics_service = MetricsService::new(false, METRICS_PORT)?; - let event_storage = EventStorage::new(EVENTS_MEM_SIZE); // TODO: state should contains the rpc_client to interact with a Madara node - let state = AppState { event_storage: Arc::new(event_storage), metrics_registry: metrics_service.registry() }; + let state = AppState { + event_storage: Arc::new(EventStorage::new(EVENTS_MEM_SIZE)), + metrics_registry: metrics_service.registry(), + }; // TODO: Should be Pragma X DNA url - see with Apibara team + should be in config let apibara_uri = "https://mainnet.starknet.a5a.ch"; // TODO: key in config / .env (...) let apibara_api_key = std::env::var("APIBARA_API_KEY")?; let indexer_service = IndexerService::new(state.clone(), apibara_uri, apibara_api_key)?; + let api_service = ApiService::new(state.clone(), config.server_host(), config.server_port()); let theoros = ServiceGroup::default().with(metrics_service).with(indexer_service).with(api_service);