mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-25 15:19:58 -07:00
rpc: init wrapper crate + global: snapshot
This commit is contained in:
@@ -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 }
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user