global: snapshot + core: impl Display for bytes structs

This commit is contained in:
nym21
2025-03-04 12:29:19 +01:00
parent fc6f12fb22
commit 0d0edd7917
36 changed files with 782 additions and 331 deletions
+58
View File
@@ -0,0 +1,58 @@
use std::path::Path;
use bitcoincore_rpc::{Auth, Client};
use brk_core::Height;
use brk_parser::Parser;
fn main() {
let i = std::time::Instant::now();
let bitcoin_dir = Path::new("../../../bitcoin");
let rpc = Box::leak(Box::new(
Client::new(
"http://localhost:8332",
Auth::CookieFile(bitcoin_dir.join(".cookie")),
)
.unwrap(),
));
// let start = None;
// let end = None;
let parser = Parser::new(bitcoin_dir.to_owned(), rpc);
// parser
// .parse(start, end)
// .iter()
// .for_each(|(height, _block, hash)| {
// println!("{height}: {hash}");
// });
println!(
"{}",
parser
.get(Height::new(0))
.txdata
.first()
.unwrap()
.output
.first()
.unwrap()
.script_pubkey
);
println!(
"{}",
parser
.get(Height::new(840_000))
.txdata
.first()
.unwrap()
.output
.first()
.unwrap()
.value
);
dbg!(i.elapsed());
}