bomputer: init

This commit is contained in:
nym21
2025-01-31 11:43:14 +01:00
parent 8c610f8a83
commit ad34d9d402
67 changed files with 498 additions and 249 deletions

View File

@@ -1,13 +1,28 @@
use structs::Date;
use std::path::Path;
use biter::rpc;
use bomputer::Computer;
use exit::Exit;
mod structs;
pub fn main() -> color_eyre::Result<()> {
let date1 = Date::from(jiff::civil::Date::constant(2009, 1, 9));
let date2 = Date::from(jiff::civil::Date::constant(2009, 1, 31));
let date3 = Date::from(jiff::civil::Date::constant(2019, 1, 9));
dbg!(usize::try_from(date1))?;
dbg!(usize::try_from(date2))?;
dbg!(usize::try_from(date3))?;
color_eyre::install()?;
let data_dir = Path::new("../../bitcoin");
let rpc = rpc::Client::new(
"http://localhost:8332",
rpc::Auth::CookieFile(Path::new(data_dir).join(".cookie")),
)?;
let exit = Exit::new();
let i = std::time::Instant::now();
let mut computer = Computer::import(Path::new("../_outputs"))?;
computer.compute(data_dir, rpc, &exit)?;
dbg!(i.elapsed());
Ok(())
}