From 38bc1c2f7b9912564c1e263dfc4a9ce7ba26edc9 Mon Sep 17 00:00:00 2001 From: dr-frmr Date: Wed, 1 May 2024 22:31:55 +0900 Subject: [PATCH] fix: notify sim-mode in kns_indexer and app_store --- kinode/packages/app_store/app_store/src/lib.rs | 3 +++ kinode/packages/kns_indexer/kns_indexer/src/lib.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/kinode/packages/app_store/app_store/src/lib.rs b/kinode/packages/app_store/app_store/src/lib.rs index 0fad6620..808f60c8 100644 --- a/kinode/packages/app_store/app_store/src/lib.rs +++ b/kinode/packages/app_store/app_store/src/lib.rs @@ -156,7 +156,10 @@ fn init(our: Address) { state = State::new(CONTRACT_ADDRESS.to_string()).unwrap(); } + #[cfg(not(feature = "simulation-mode"))] println!("indexing on contract address {}", state.contract_address); + #[cfg(feature = "simulation-mode")] + println!("simulation mode: not indexing packages"); // create new provider for sepolia with request-timeout of 60s // can change, log requests can take quite a long time. diff --git a/kinode/packages/kns_indexer/kns_indexer/src/lib.rs b/kinode/packages/kns_indexer/kns_indexer/src/lib.rs index 33faa818..799dcc7e 100644 --- a/kinode/packages/kns_indexer/kns_indexer/src/lib.rs +++ b/kinode/packages/kns_indexer/kns_indexer/src/lib.rs @@ -120,7 +120,10 @@ call_init!(init); fn init(our: Address) { let (chain_id, contract_address) = (10, KNS_OPTIMISM_ADDRESS.to_string()); + #[cfg(not(feature = "simulation-mode"))] println!("indexing on contract address {}", contract_address); + #[cfg(feature = "simulation-mode")] + println!("simulation mode: not indexing KNS"); // if we have state, load it in let state: State = match get_typed_state(|bytes| Ok(bincode::deserialize::(bytes)?)) {