Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ examples/*
!examples/rindexer_factory_indexing
!examples/rindexer_rust_playground
!examples/rust_clickhouse
!examples/rindexer_sqlite_db
!examples/clickhouse_factory_indexing
documentation/node_modules
documentation/dist
Expand Down
58 changes: 52 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ RUN apt-get update && apt-get install -y \
ca-certificates \
curl \
git \
libsqlite3-0 \
&& rm -rf /var/lib/apt/lists/*

RUN curl -L https://foundry.paradigm.xyz | bash
Expand Down
2 changes: 2 additions & 0 deletions cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ new_rust:
RUSTFLAGS='-C target-cpu=native' cargo run --release --features jemalloc -- new --path $(CURDIR)/../examples rust
start_indexer:
RUSTFLAGS='-C target-cpu=native' RUST_BACKTRACE='full' cargo run --release --features jemalloc -- start --path $(CURDIR)/../examples/rindexer_demo_cli indexer
start_sqlite:
RUSTFLAGS='-C target-cpu=native' RUST_BACKTRACE='full' cargo run --release --features jemalloc -- start --path $(CURDIR)/../examples/rindexer_sqlite_db indexer
start_all:
RUSTFLAGS='-C target-cpu=native' RUST_BACKTRACE='full' cargo run --release --features jemalloc -- start --path $(CURDIR)/../examples/rindexer_demo_cli all
start_graphql:
Expand Down
21 changes: 18 additions & 3 deletions cli/src/commands/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ use alloy::{
primitives::{Address, U64},
rpc::types::ValueOrArray,
};
use rindexer::manifest::config::Config;
use rindexer::manifest::contract::ContractEvent;
use rindexer::manifest::global::Global;
#[cfg(feature = "reth")]
use rindexer::manifest::reth::RethConfig;
use rindexer::manifest::storage::ClickhouseDetails;
use rindexer::manifest::{config::Config, storage::SqliteDetails};
use rindexer::{
generator::{build::generate_rust_project, generate_docker_file},
manifest::{
Expand Down Expand Up @@ -155,7 +155,13 @@ pub fn handle_new_command(
let repository = prompt_for_optional_input::<String>("Repository", None);
let storage_choice = prompt_for_input_list(
"What Storages To Enable? (graphql can only be supported if postgres is enabled)",
&["postgres".to_string(), "clickhouse".to_string(), "csv".to_string(), "none".to_string()],
&[
"postgres".to_string(),
"clickhouse".to_string(),
"csv".to_string(),
"sqlite".to_string(),
"none".to_string(),
],
None,
);
let mut postgres_docker_enable = false;
Expand All @@ -171,7 +177,7 @@ pub fn handle_new_command(
let postgres_enabled = storage_choice == "postgres";
let csv_enabled = storage_choice == "csv";
let clickhouse_enabled = storage_choice == "clickhouse";

let sqlite_enabled = storage_choice == "sqlite";
// Handle Reth configuration if enabled
let final_reth_config = get_reth_config(reth_config);

Expand Down Expand Up @@ -284,6 +290,15 @@ pub fn handle_new_command(
} else {
None
},
sqlite: if sqlite_enabled {
Some(SqliteDetails {
enabled: true,
drop_each_run: None,
disable_create_tables: None,
})
} else {
None
},
},
graphql: None,
};
Expand Down
1 change: 1 addition & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ redis = { version = "0.32.7", features = ["streams"] }
regex = "1.12.2"
reqwest = { version = "0.12.24", features = ["json", "gzip"] }
rust_decimal = { version = "1.39.0", features = ["db-tokio-postgres"] }
rusqlite = "0.36"
serde = "1.0"
serde_json = "1.0"
serde_yaml = "0.9.34"
Expand Down
6 changes: 3 additions & 3 deletions core/src/blockclock/runlencoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -692,11 +692,11 @@ mod tests {
return Ok(());
}

let mut encoder = DeltaEncoder::new(network_id, Some(&rpc_url), &file_path);
Copy link
Author

@bh2smith bh2smith Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These irrelevant changes were clippy warnings (possibly on a newer rust version than CI).

let mut encoder = DeltaEncoder::new(network_id, Some(rpc_url), &file_path);
encoder.fetch_encode_persist(100).await?;
drop(encoder);

let mut reloaded = DeltaEncoder::from_file_inner(network_id, Some(&rpc_url), &file_path)?;
let mut reloaded = DeltaEncoder::from_file_inner(network_id, Some(rpc_url), &file_path)?;

reloaded.fetch_encode_persist(100).await?;

Expand Down Expand Up @@ -739,7 +739,7 @@ mod tests {
return Ok(());
}

let reloaded = DeltaEncoder::from_file(network_id, Some(&rpc_url), &base_path)?;
let reloaded = DeltaEncoder::from_file(network_id, Some(rpc_url), &base_path)?;
let mut samples = Vec::with_capacity(sample_count);

for _ in 1..=sample_count {
Expand Down
1 change: 1 addition & 0 deletions core/src/database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ pub mod clickhouse;
pub mod generate;
pub mod postgres;
pub mod sql_type_wrapper;
pub mod sqlite;
Loading