rpc: init wrapper crate + global: snapshot

This commit is contained in:
nym21
2025-10-20 23:06:25 +02:00
parent 9b230d23dd
commit 4ffa2e3993
39 changed files with 1055 additions and 832 deletions

View File

@@ -24,7 +24,7 @@ brk_structs = { workspace = true }
brk_traversable = { workspace = true }
derive_deref = { workspace = true }
log = { workspace = true }
pco = "0.4.6"
pco = "0.4.7"
rayon = { workspace = true }
serde = { workspace = true }
vecdb = { workspace = true }

View File

@@ -34,7 +34,7 @@ pub fn main() -> Result<()> {
let outputs_dir = Path::new(&std::env::var("HOME").unwrap()).join(".brk");
// let outputs_dir = Path::new("../../_outputs");
let parser = Reader::new(bitcoin_dir.join("blocks"), rpc);
let reader = Reader::new(bitcoin_dir.join("blocks"), rpc);
let mut indexer = Indexer::forced_import(&outputs_dir)?;
@@ -44,8 +44,8 @@ pub fn main() -> Result<()> {
loop {
let i = Instant::now();
let starting_indexes = indexer.index(&parser, rpc, &exit, true)?;
computer.compute(&indexer, starting_indexes, &parser, &exit)?;
let starting_indexes = indexer.index(&reader, rpc, &exit, true)?;
computer.compute(&indexer, starting_indexes, &reader, &exit)?;
dbg!(i.elapsed());
sleep(Duration::from_secs(10));
}

View File

@@ -70,6 +70,8 @@ impl Computer {
price::Vecs::forced_import(&computed_path, VERSION + Version::ZERO, &indexes).unwrap()
});
import in theads
Ok(Self {
constants: constants::Vecs::forced_import(
&computed_path,