mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-25 07:09:59 -07:00
global: snapshot
This commit is contained in:
@@ -9,7 +9,7 @@ use brk_rpc::{Auth, Client};
|
||||
use clap::Parser;
|
||||
use serde::{Deserialize, Deserializer, Serialize};
|
||||
|
||||
use crate::{default_bitcoin_path, default_brk_path, dot_brk_path, website::Website};
|
||||
use crate::{default_brk_path, dot_brk_path, website::Website};
|
||||
|
||||
const DOWNLOADS: &str = "downloads";
|
||||
|
||||
@@ -197,14 +197,14 @@ Finally, you can run the program with '-h' for help."
|
||||
}
|
||||
|
||||
pub fn rpc(&self) -> Result<Client> {
|
||||
Ok(Client::new(
|
||||
Client::new(
|
||||
&format!(
|
||||
"http://{}:{}",
|
||||
self.rpcconnect().unwrap_or(&"localhost".to_string()),
|
||||
self.rpcport().unwrap_or(8332)
|
||||
),
|
||||
self.rpc_auth().unwrap(),
|
||||
)?)
|
||||
self.rpc_auth()?,
|
||||
)
|
||||
}
|
||||
|
||||
fn rpc_auth(&self) -> Result<Auth> {
|
||||
@@ -233,7 +233,9 @@ Finally, you can run the program with '-h' for help."
|
||||
pub fn bitcoindir(&self) -> PathBuf {
|
||||
self.bitcoindir
|
||||
.as_ref()
|
||||
.map_or_else(default_bitcoin_path, |s| Self::fix_user_path(s.as_ref()))
|
||||
.map_or_else(Client::default_bitcoin_path, |s| {
|
||||
Self::fix_user_path(s.as_ref())
|
||||
})
|
||||
}
|
||||
|
||||
pub fn blocksdir(&self) -> PathBuf {
|
||||
|
||||
@@ -8,13 +8,13 @@ use std::{
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use brk_binder::Bridge;
|
||||
use brk_binder::generate_js_files;
|
||||
use brk_bundler::bundle;
|
||||
use brk_computer::Computer;
|
||||
use brk_error::Result;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_iterator::Blocks;
|
||||
use brk_query::Query;
|
||||
use brk_query::AsyncQuery;
|
||||
use brk_reader::Reader;
|
||||
use brk_server::{Server, VERSION};
|
||||
use log::info;
|
||||
@@ -57,7 +57,7 @@ pub fn run() -> color_eyre::Result<()> {
|
||||
|
||||
let mut computer = Computer::forced_import(&config.brkdir(), &indexer, config.fetcher())?;
|
||||
|
||||
let query = Query::build(&reader, &indexer, &computer);
|
||||
let query = AsyncQuery::build(&reader, &indexer, &computer);
|
||||
|
||||
let website = config.website();
|
||||
|
||||
@@ -100,7 +100,7 @@ pub fn run() -> color_eyre::Result<()> {
|
||||
modules_path = downloaded_modules_path;
|
||||
}
|
||||
|
||||
query.generate_js_files(&modules_path)?;
|
||||
generate_js_files(query.inner(), &modules_path)?;
|
||||
|
||||
Some(
|
||||
bundle(
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
use std::{
|
||||
env,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
pub fn dot_brk_path() -> PathBuf {
|
||||
let home = std::env::var("HOME").unwrap();
|
||||
|
||||
Reference in New Issue
Block a user