From aa258a76a96318f9372193041609b97433150ca7 Mon Sep 17 00:00:00 2001 From: larkooo Date: Thu, 11 Apr 2024 12:17:00 -0400 Subject: [PATCH] featL add flag for indexing everything --- bin/torii/src/main.rs | 5 +++++ crates/torii/core/src/engine.rs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/torii/src/main.rs b/bin/torii/src/main.rs index a14ff3d4c0..98b56cc2d5 100644 --- a/bin/torii/src/main.rs +++ b/bin/torii/src/main.rs @@ -109,6 +109,10 @@ struct Args { /// Chunk size of the events page when indexing using events #[arg(long, default_value = "1000")] events_chunk_size: u64, + + /// Index all blocks and transactions + #[arg(long, default_value = "false")] + all: bool, } #[tokio::main] @@ -179,6 +183,7 @@ async fn main() -> anyhow::Result<()> { EngineConfig { start_block: args.start_block, events_chunk_size: args.events_chunk_size, + index_all: args.all, ..Default::default() }, shutdown_tx.clone(), diff --git a/crates/torii/core/src/engine.rs b/crates/torii/core/src/engine.rs index 210fce2b60..c868c377e3 100644 --- a/crates/torii/core/src/engine.rs +++ b/crates/torii/core/src/engine.rs @@ -36,11 +36,12 @@ pub struct EngineConfig { pub block_time: Duration, pub start_block: u64, pub events_chunk_size: u64, + pub index_all: bool, } impl Default for EngineConfig { fn default() -> Self { - Self { block_time: Duration::from_secs(1), start_block: 0, events_chunk_size: 1000 } + Self { block_time: Duration::from_secs(1), start_block: 0, events_chunk_size: 1000, index_all: false } } }