mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-25 23:29:58 -07:00
global: wip
This commit is contained in:
@@ -9,7 +9,7 @@ use brk_core::Version;
|
||||
use brk_exit::Exit;
|
||||
use brk_fetcher::Fetcher;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{AnyCollectableVec, Compressed, Computation};
|
||||
use brk_vec::{AnyCollectableVec, Computation, Format};
|
||||
|
||||
mod stores;
|
||||
mod utils;
|
||||
@@ -25,19 +25,19 @@ pub struct Computer {
|
||||
fetcher: Option<Fetcher>,
|
||||
vecs: Option<Vecs>,
|
||||
stores: Option<Stores>,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
}
|
||||
|
||||
const VERSION: Version = Version::ONE;
|
||||
|
||||
impl Computer {
|
||||
pub fn new(outputs_dir: &Path, fetcher: Option<Fetcher>, compressed: bool) -> Self {
|
||||
pub fn new(outputs_dir: &Path, fetcher: Option<Fetcher>, format: Format) -> Self {
|
||||
Self {
|
||||
path: outputs_dir.to_owned(),
|
||||
fetcher,
|
||||
vecs: None,
|
||||
stores: None,
|
||||
compressed: Compressed::from(compressed),
|
||||
format,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ impl Computer {
|
||||
indexer,
|
||||
self.fetcher.is_some(),
|
||||
computation,
|
||||
self.compressed,
|
||||
self.format,
|
||||
indexer.keyspace(),
|
||||
)?);
|
||||
Ok(())
|
||||
@@ -80,15 +80,10 @@ impl Computer {
|
||||
exit: &Exit,
|
||||
) -> color_eyre::Result<()> {
|
||||
info!("Computing...");
|
||||
|
||||
self.vecs.as_mut().unwrap().compute(
|
||||
indexer,
|
||||
starting_indexes,
|
||||
self.fetcher.as_mut(),
|
||||
exit,
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
self.vecs
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
.compute(indexer, starting_indexes, self.fetcher.as_mut(), exit)
|
||||
}
|
||||
|
||||
pub fn vecs(&self) -> Vec<&dyn AnyCollectableVec> {
|
||||
|
||||
@@ -6,7 +6,7 @@ use brk_core::{
|
||||
};
|
||||
use brk_exit::Exit;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{AnyCollectableVec, AnyIterableVec, Compressed, Computation, EagerVec};
|
||||
use brk_vec::{AnyCollectableVec, AnyIterableVec, Computation, EagerVec, Format};
|
||||
|
||||
use super::{
|
||||
Indexes,
|
||||
@@ -35,7 +35,7 @@ impl Vecs {
|
||||
path: &Path,
|
||||
version: Version,
|
||||
_computation: Computation,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
) -> color_eyre::Result<Self> {
|
||||
fs::create_dir_all(path)?;
|
||||
|
||||
@@ -44,14 +44,14 @@ impl Vecs {
|
||||
path,
|
||||
"interval",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
timeindexes_to_timestamp: ComputedVecsFromDateIndex::forced_import(
|
||||
path,
|
||||
"timestamp",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_first(),
|
||||
)?,
|
||||
indexes_to_block_interval: ComputedVecsFromHeight::forced_import(
|
||||
@@ -59,7 +59,7 @@ impl Vecs {
|
||||
"block_interval",
|
||||
false,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_percentiles()
|
||||
.add_minmax()
|
||||
@@ -70,7 +70,7 @@ impl Vecs {
|
||||
"block_count",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_sum()
|
||||
.add_cumulative(),
|
||||
@@ -80,7 +80,7 @@ impl Vecs {
|
||||
"block_weight",
|
||||
false,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_sum()
|
||||
.add_cumulative(),
|
||||
@@ -90,7 +90,7 @@ impl Vecs {
|
||||
"block_size",
|
||||
false,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_sum()
|
||||
.add_cumulative(),
|
||||
@@ -99,14 +99,14 @@ impl Vecs {
|
||||
path,
|
||||
"vbytes",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
indexes_to_block_vbytes: ComputedVecsFromHeight::forced_import(
|
||||
path,
|
||||
"block_vbytes",
|
||||
false,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_sum()
|
||||
.add_cumulative(),
|
||||
@@ -115,13 +115,13 @@ impl Vecs {
|
||||
path,
|
||||
"timestamp",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
halvingepoch_to_timestamp: EagerVec::forced_import(
|
||||
path,
|
||||
"timestamp",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::{fs, path::Path};
|
||||
use brk_core::{StoredU8, Version};
|
||||
use brk_exit::Exit;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{AnyCollectableVec, AnyVec, Compressed, Computation};
|
||||
use brk_vec::{AnyCollectableVec, AnyVec, Computation, Format};
|
||||
|
||||
use super::{
|
||||
Indexes,
|
||||
@@ -26,7 +26,7 @@ impl Vecs {
|
||||
path: &Path,
|
||||
version: Version,
|
||||
_computation: Computation,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
) -> color_eyre::Result<Self> {
|
||||
fs::create_dir_all(path)?;
|
||||
|
||||
@@ -36,7 +36,7 @@ impl Vecs {
|
||||
"0",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_last(),
|
||||
)?,
|
||||
_1: ComputedVecsFromHeight::forced_import(
|
||||
@@ -44,7 +44,7 @@ impl Vecs {
|
||||
"1",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_last(),
|
||||
)?,
|
||||
_50: ComputedVecsFromHeight::forced_import(
|
||||
@@ -52,7 +52,7 @@ impl Vecs {
|
||||
"50",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_last(),
|
||||
)?,
|
||||
_100: ComputedVecsFromHeight::forced_import(
|
||||
@@ -60,7 +60,7 @@ impl Vecs {
|
||||
"100",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_last(),
|
||||
)?,
|
||||
})
|
||||
|
||||
@@ -7,7 +7,7 @@ use brk_core::{
|
||||
use brk_exit::Exit;
|
||||
use brk_fetcher::Fetcher;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{AnyCollectableVec, AnyIterableVec, Compressed, Computation, EagerVec};
|
||||
use brk_vec::{AnyCollectableVec, AnyIterableVec, Computation, EagerVec, Format};
|
||||
|
||||
use super::{
|
||||
Indexes,
|
||||
@@ -73,7 +73,7 @@ impl Vecs {
|
||||
path: &Path,
|
||||
version: Version,
|
||||
_computation: Computation,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
) -> color_eyre::Result<Self> {
|
||||
fs::create_dir_all(path)?;
|
||||
|
||||
@@ -86,92 +86,92 @@ impl Vecs {
|
||||
&fetched_path,
|
||||
"ohlc_in_cents",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
dateindex_to_ohlc: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
dateindex_to_ohlc_in_sats: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc_in_sats",
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
dateindex_to_close_in_cents: EagerVec::forced_import(
|
||||
path,
|
||||
"close_in_cents",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
dateindex_to_high_in_cents: EagerVec::forced_import(
|
||||
path,
|
||||
"high_in_cents",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
dateindex_to_low_in_cents: EagerVec::forced_import(
|
||||
path,
|
||||
"low_in_cents",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
dateindex_to_open_in_cents: EagerVec::forced_import(
|
||||
path,
|
||||
"open_in_cents",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
height_to_ohlc_in_cents: EagerVec::forced_import(
|
||||
&fetched_path,
|
||||
"ohlc_in_cents",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
height_to_ohlc: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
height_to_ohlc_in_sats: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc_in_sats",
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
height_to_close_in_cents: EagerVec::forced_import(
|
||||
path,
|
||||
"close_in_cents",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
height_to_high_in_cents: EagerVec::forced_import(
|
||||
path,
|
||||
"high_in_cents",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
height_to_low_in_cents: EagerVec::forced_import(
|
||||
path,
|
||||
"low_in_cents",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
height_to_open_in_cents: EagerVec::forced_import(
|
||||
path,
|
||||
"open_in_cents",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
timeindexes_to_open: ComputedVecsFromDateIndex::forced_import(
|
||||
path,
|
||||
"open",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_first(),
|
||||
)?,
|
||||
timeindexes_to_high: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -179,7 +179,7 @@ impl Vecs {
|
||||
"high",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_max(),
|
||||
)?,
|
||||
timeindexes_to_low: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -187,7 +187,7 @@ impl Vecs {
|
||||
"low",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_min(),
|
||||
)?,
|
||||
timeindexes_to_close: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -195,7 +195,7 @@ impl Vecs {
|
||||
"close",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_last(),
|
||||
)?,
|
||||
timeindexes_to_open_in_sats: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -203,7 +203,7 @@ impl Vecs {
|
||||
"open_in_sats",
|
||||
true,
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_first(),
|
||||
)?,
|
||||
timeindexes_to_high_in_sats: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -211,7 +211,7 @@ impl Vecs {
|
||||
"high_in_sats",
|
||||
true,
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_max(),
|
||||
)?,
|
||||
timeindexes_to_low_in_sats: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -219,7 +219,7 @@ impl Vecs {
|
||||
"low_in_sats",
|
||||
true,
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_min(),
|
||||
)?,
|
||||
timeindexes_to_close_in_sats: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -227,138 +227,138 @@ impl Vecs {
|
||||
"close_in_sats",
|
||||
true,
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_last(),
|
||||
)?,
|
||||
chainindexes_to_open: ComputedVecsFromHeightStrict::forced_import(
|
||||
path,
|
||||
"open",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_first(),
|
||||
)?,
|
||||
chainindexes_to_high: ComputedVecsFromHeightStrict::forced_import(
|
||||
path,
|
||||
"high",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_max(),
|
||||
)?,
|
||||
chainindexes_to_low: ComputedVecsFromHeightStrict::forced_import(
|
||||
path,
|
||||
"low",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_min(),
|
||||
)?,
|
||||
chainindexes_to_close: ComputedVecsFromHeightStrict::forced_import(
|
||||
path,
|
||||
"close",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_last(),
|
||||
)?,
|
||||
chainindexes_to_open_in_sats: ComputedVecsFromHeightStrict::forced_import(
|
||||
path,
|
||||
"open_in_sats",
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_first(),
|
||||
)?,
|
||||
chainindexes_to_high_in_sats: ComputedVecsFromHeightStrict::forced_import(
|
||||
path,
|
||||
"high_in_sats",
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_max(),
|
||||
)?,
|
||||
chainindexes_to_low_in_sats: ComputedVecsFromHeightStrict::forced_import(
|
||||
path,
|
||||
"low_in_sats",
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_min(),
|
||||
)?,
|
||||
chainindexes_to_close_in_sats: ComputedVecsFromHeightStrict::forced_import(
|
||||
path,
|
||||
"close_in_sats",
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_last(),
|
||||
)?,
|
||||
weekindex_to_ohlc: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
weekindex_to_ohlc_in_sats: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc_in_sats",
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
difficultyepoch_to_ohlc: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
difficultyepoch_to_ohlc_in_sats: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc_in_sats",
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
monthindex_to_ohlc: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
monthindex_to_ohlc_in_sats: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc_in_sats",
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
quarterindex_to_ohlc: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
quarterindex_to_ohlc_in_sats: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc_in_sats",
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
yearindex_to_ohlc: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
yearindex_to_ohlc_in_sats: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc_in_sats",
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
// halvingepoch_to_ohlc: StorableVec::forced_import(path,
|
||||
// "halvingepoch_to_ohlc"), version + VERSION + Version::ZERO, compressed)?,
|
||||
// "halvingepoch_to_ohlc"), version + VERSION + Version::ZERO, format)?,
|
||||
decadeindex_to_ohlc: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
decadeindex_to_ohlc_in_sats: EagerVec::forced_import(
|
||||
path,
|
||||
"ohlc_in_sats",
|
||||
version + VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::path::Path;
|
||||
|
||||
use brk_core::{CheckedSub, Result, StoredUsize, Version};
|
||||
use brk_exit::Exit;
|
||||
use brk_vec::{AnyCollectableVec, AnyIterableVec, Compressed, EagerVec, StoredIndex, StoredType};
|
||||
use brk_vec::{AnyCollectableVec, AnyIterableVec, EagerVec, Format, StoredIndex, StoredType};
|
||||
use color_eyre::eyre::ContextCompat;
|
||||
|
||||
use crate::utils::get_percentile;
|
||||
@@ -40,7 +40,7 @@ where
|
||||
path: &Path,
|
||||
name: &str,
|
||||
version: Version,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
options: StorableVecGeneatorOptions,
|
||||
) -> color_eyre::Result<Self> {
|
||||
let only_one_active = options.is_only_one_active();
|
||||
@@ -72,15 +72,14 @@ where
|
||||
path,
|
||||
&maybe_prefix("first"),
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
}),
|
||||
last: options.last.then(|| {
|
||||
Box::new(
|
||||
EagerVec::forced_import(path, name, version + Version::ZERO, compressed)
|
||||
.unwrap(),
|
||||
EagerVec::forced_import(path, name, version + Version::ZERO, format).unwrap(),
|
||||
)
|
||||
}),
|
||||
min: options.min.then(|| {
|
||||
@@ -89,7 +88,7 @@ where
|
||||
path,
|
||||
&maybe_suffix("min"),
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
@@ -100,7 +99,7 @@ where
|
||||
path,
|
||||
&maybe_suffix("max"),
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
@@ -111,7 +110,7 @@ where
|
||||
path,
|
||||
&maybe_suffix("median"),
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
@@ -122,7 +121,7 @@ where
|
||||
path,
|
||||
&maybe_suffix("average"),
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
@@ -133,7 +132,7 @@ where
|
||||
path,
|
||||
&maybe_suffix("sum"),
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
@@ -144,7 +143,7 @@ where
|
||||
path,
|
||||
&prefix("cumulative"),
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
@@ -155,7 +154,7 @@ where
|
||||
path,
|
||||
&maybe_suffix("90p"),
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
@@ -166,7 +165,7 @@ where
|
||||
path,
|
||||
&maybe_suffix("75p"),
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
@@ -177,7 +176,7 @@ where
|
||||
path,
|
||||
&maybe_suffix("25p"),
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
@@ -188,7 +187,7 @@ where
|
||||
path,
|
||||
&maybe_suffix("10p"),
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ use brk_core::{
|
||||
};
|
||||
use brk_exit::Exit;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{AnyCollectableVec, AnyIterableVec, Compressed, EagerVec};
|
||||
use brk_vec::{AnyCollectableVec, AnyIterableVec, EagerVec, Format};
|
||||
|
||||
use crate::vecs::{Indexes, indexes};
|
||||
|
||||
@@ -36,19 +36,18 @@ where
|
||||
name: &str,
|
||||
compute_source: bool,
|
||||
version: Version,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
options: StorableVecGeneatorOptions,
|
||||
) -> color_eyre::Result<Self> {
|
||||
let dateindex = compute_source.then(|| {
|
||||
EagerVec::forced_import(path, name, version + VERSION + Version::ZERO, compressed)
|
||||
.unwrap()
|
||||
EagerVec::forced_import(path, name, version + VERSION + Version::ZERO, format).unwrap()
|
||||
});
|
||||
|
||||
let dateindex_extra = ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options.copy_self_extra(),
|
||||
)?;
|
||||
|
||||
@@ -61,35 +60,35 @@ where
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
monthindex: ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
quarterindex: ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
yearindex: ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
decadeindex: ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
})
|
||||
|
||||
@@ -6,7 +6,7 @@ use brk_core::{
|
||||
};
|
||||
use brk_exit::Exit;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{AnyCollectableVec, AnyIterableVec, Compressed, EagerVec};
|
||||
use brk_vec::{AnyCollectableVec, AnyIterableVec, EagerVec, Format};
|
||||
|
||||
use crate::vecs::{Indexes, indexes};
|
||||
|
||||
@@ -41,19 +41,18 @@ where
|
||||
name: &str,
|
||||
compute_source: bool,
|
||||
version: Version,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
options: StorableVecGeneatorOptions,
|
||||
) -> color_eyre::Result<Self> {
|
||||
let height = compute_source.then(|| {
|
||||
EagerVec::forced_import(path, name, version + VERSION + Version::ZERO, compressed)
|
||||
.unwrap()
|
||||
EagerVec::forced_import(path, name, version + VERSION + Version::ZERO, format).unwrap()
|
||||
});
|
||||
|
||||
let height_extra = ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options.copy_self_extra(),
|
||||
)?;
|
||||
|
||||
@@ -61,7 +60,7 @@ where
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?;
|
||||
|
||||
@@ -75,43 +74,43 @@ where
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
difficultyepoch: ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
monthindex: ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
quarterindex: ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
yearindex: ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
// halvingepoch: StorableVecGeneator::forced_import(path, name, version + VERSION + Version::ZERO, compressed, options)?,
|
||||
// halvingepoch: StorableVecGeneator::forced_import(path, name, version + VERSION + Version::ZERO, format, options)?,
|
||||
decadeindex: ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
})
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::path::Path;
|
||||
use brk_core::{DifficultyEpoch, Height, Result, Version};
|
||||
use brk_exit::Exit;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{AnyCollectableVec, Compressed, EagerVec};
|
||||
use brk_vec::{AnyCollectableVec, EagerVec, Format};
|
||||
|
||||
use crate::vecs::{Indexes, indexes};
|
||||
|
||||
@@ -31,17 +31,17 @@ where
|
||||
path: &Path,
|
||||
name: &str,
|
||||
version: Version,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
options: StorableVecGeneatorOptions,
|
||||
) -> color_eyre::Result<Self> {
|
||||
let height =
|
||||
EagerVec::forced_import(path, name, version + VERSION + Version::ZERO, compressed)?;
|
||||
EagerVec::forced_import(path, name, version + VERSION + Version::ZERO, format)?;
|
||||
|
||||
let height_extra = ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options.copy_self_extra(),
|
||||
)?;
|
||||
|
||||
@@ -54,10 +54,10 @@ where
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
// halvingepoch: StorableVecGeneator::forced_import(path, name, version + VERSION + Version::ZERO, compressed, options)?,
|
||||
// halvingepoch: StorableVecGeneator::forced_import(path, name, version + VERSION + Version::ZERO, format, options)?,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ use brk_core::{
|
||||
use brk_exit::Exit;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{
|
||||
AnyCollectableVec, AnyVec, CollectableVec, Compressed, EagerVec, StoredIndex, VecIterator,
|
||||
AnyCollectableVec, AnyVec, CollectableVec, EagerVec, Format, StoredIndex, VecIterator,
|
||||
};
|
||||
|
||||
use crate::vecs::{Indexes, fetched, indexes};
|
||||
@@ -43,12 +43,12 @@ where
|
||||
name: &str,
|
||||
compute_source: bool,
|
||||
version: Version,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
options: StorableVecGeneatorOptions,
|
||||
) -> color_eyre::Result<Self> {
|
||||
let txindex = compute_source.then(|| {
|
||||
Box::new(
|
||||
EagerVec::forced_import(path, name, version + VERSION + Version::ZERO, compressed)
|
||||
EagerVec::forced_import(path, name, version + VERSION + Version::ZERO, format)
|
||||
.unwrap(),
|
||||
)
|
||||
});
|
||||
@@ -57,7 +57,7 @@ where
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?;
|
||||
|
||||
@@ -70,50 +70,50 @@ where
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
weekindex: ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
difficultyepoch: ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
monthindex: ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
quarterindex: ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
yearindex: ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
// halvingepoch: StorableVecGeneator::forced_import(path, name, version + VERSION + Version::ZERO, compressed, options)?,
|
||||
// halvingepoch: StorableVecGeneator::forced_import(path, name, version + VERSION + Version::ZERO, format, options)?,
|
||||
decadeindex: ComputedVecBuilder::forced_import(
|
||||
path,
|
||||
name,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
})
|
||||
|
||||
@@ -4,7 +4,7 @@ use brk_core::{Date, DateIndex, Dollars, Result, StoredF32, Version};
|
||||
use brk_exit::Exit;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{
|
||||
AnyCollectableVec, AnyIterableVec, AnyVec, CollectableVec, Compressed, EagerVec, StoredIndex,
|
||||
AnyCollectableVec, AnyIterableVec, AnyVec, CollectableVec, EagerVec, Format, StoredIndex,
|
||||
VecIterator,
|
||||
};
|
||||
|
||||
@@ -61,7 +61,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
name: &str,
|
||||
compute_source: bool,
|
||||
version: Version,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
options: StorableVecGeneatorOptions,
|
||||
) -> color_eyre::Result<Self> {
|
||||
Ok(Self {
|
||||
@@ -71,7 +71,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
name,
|
||||
true,
|
||||
version + VERSION,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)
|
||||
.unwrap()
|
||||
@@ -81,7 +81,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_sma: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -89,7 +89,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_sma"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_1w_sma: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -97,7 +97,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_1w_sma"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_1m_sma: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -105,7 +105,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_1m_sma"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_1y_sma: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -113,7 +113,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_1y_sma"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_1y_sma_momentum_oscillator: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -121,7 +121,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_1y_sma_momentum_oscillator"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_standard_deviation: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -129,7 +129,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_standard_deviation"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p99_9: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -137,7 +137,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p99_9"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p99_5: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -145,7 +145,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p99_5"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p99: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -153,7 +153,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p99"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p1: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -161,7 +161,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p1"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p0_5: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -169,7 +169,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p0_5"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p0_1: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -177,7 +177,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p0_1"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p1sd: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -185,7 +185,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p1sd"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p2sd: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -193,7 +193,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p2sd"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p3sd: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -201,7 +201,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p3sd"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_m1sd: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -209,7 +209,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_m1sd"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_m2sd: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -217,7 +217,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_m2sd"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_m3sd: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -225,7 +225,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_m3sd"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p99_9_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -233,7 +233,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p99_9_as_price"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p99_5_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -241,7 +241,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p99_5_as_price"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p99_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -249,7 +249,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p99_as_price"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p1_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -257,7 +257,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p1_as_price"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p0_5_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -265,7 +265,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p0_5_as_price"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p0_1_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -273,7 +273,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p0_1_as_price"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p1sd_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -281,7 +281,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p1sd_as_price"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p2sd_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -289,7 +289,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p2sd_as_price"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_p3sd_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -297,7 +297,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_p3sd_as_price"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_m1sd_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -305,7 +305,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_m1sd_as_price"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_m2sd_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -313,7 +313,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_m2sd_as_price"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_m3sd_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -321,7 +321,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_m3sd_as_price"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
ratio_zscore: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -329,7 +329,7 @@ impl ComputedRatioVecsFromDateIndex {
|
||||
&format!("{name}_ratio_zscore"),
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
})
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::path::Path;
|
||||
use brk_core::{Bitcoin, Dollars, Height, Result, Sats, Version};
|
||||
use brk_exit::Exit;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{AnyCollectableVec, CollectableVec, Compressed, EagerVec, StoredVec};
|
||||
use brk_vec::{AnyCollectableVec, CollectableVec, EagerVec, Format, StoredVec};
|
||||
|
||||
use crate::vecs::{Indexes, fetched, indexes};
|
||||
|
||||
@@ -24,7 +24,7 @@ impl ComputedValueVecsFromHeight {
|
||||
name: &str,
|
||||
compute_source: bool,
|
||||
version: Version,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
options: StorableVecGeneatorOptions,
|
||||
compute_dollars: bool,
|
||||
) -> color_eyre::Result<Self> {
|
||||
@@ -34,7 +34,7 @@ impl ComputedValueVecsFromHeight {
|
||||
name,
|
||||
compute_source,
|
||||
version + VERSION,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
bitcoin: ComputedVecsFromHeight::forced_import(
|
||||
@@ -42,7 +42,7 @@ impl ComputedValueVecsFromHeight {
|
||||
&format!("{name}_in_btc"),
|
||||
true,
|
||||
version + VERSION,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?,
|
||||
dollars: compute_dollars.then(|| {
|
||||
@@ -51,7 +51,7 @@ impl ComputedValueVecsFromHeight {
|
||||
&format!("{name}_in_usd"),
|
||||
true,
|
||||
version + VERSION,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)
|
||||
.unwrap()
|
||||
|
||||
@@ -4,8 +4,8 @@ use brk_core::{Bitcoin, Close, Dollars, Height, Sats, TxIndex, Version};
|
||||
use brk_exit::Exit;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{
|
||||
AnyCollectableVec, BoxedAnyIterableVec, CloneableAnyIterableVec, CollectableVec, Compressed,
|
||||
Computation, ComputedVecFrom3, LazyVecFrom1, StoredIndex, StoredVec,
|
||||
AnyCollectableVec, BoxedAnyIterableVec, CloneableAnyIterableVec, CollectableVec, Computation,
|
||||
ComputedVecFrom3, Format, LazyVecFrom1, StoredIndex, StoredVec,
|
||||
};
|
||||
|
||||
use crate::vecs::{Indexes, fetched, indexes};
|
||||
@@ -44,7 +44,7 @@ impl ComputedValueVecsFromTxindex {
|
||||
source: Option<BoxedAnyIterableVec<TxIndex, Sats>>,
|
||||
version: Version,
|
||||
computation: Computation,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
fetched: Option<&fetched::Vecs>,
|
||||
options: StorableVecGeneatorOptions,
|
||||
) -> color_eyre::Result<Self> {
|
||||
@@ -59,7 +59,7 @@ impl ComputedValueVecsFromTxindex {
|
||||
name,
|
||||
compute_source,
|
||||
version + VERSION,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?;
|
||||
|
||||
@@ -80,7 +80,7 @@ impl ComputedValueVecsFromTxindex {
|
||||
&name_in_btc,
|
||||
false,
|
||||
version + VERSION,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)?;
|
||||
|
||||
@@ -90,7 +90,7 @@ impl ComputedValueVecsFromTxindex {
|
||||
path,
|
||||
&name_in_usd,
|
||||
version + VERSION,
|
||||
compressed,
|
||||
format,
|
||||
bitcoin_txindex.boxed_clone(),
|
||||
indexes.txindex_to_height.boxed_clone(),
|
||||
fetched.chainindexes_to_close.height.boxed_clone(),
|
||||
@@ -126,7 +126,7 @@ impl ComputedValueVecsFromTxindex {
|
||||
&name_in_usd,
|
||||
false,
|
||||
version + VERSION,
|
||||
compressed,
|
||||
format,
|
||||
options,
|
||||
)
|
||||
.unwrap()
|
||||
|
||||
@@ -10,10 +10,12 @@ use brk_core::{
|
||||
use brk_exit::Exit;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{
|
||||
AnyCollectableVec, CloneableAnyIterableVec, Compressed, Computation, ComputedVec,
|
||||
ComputedVecFrom1, ComputedVecFrom2, EagerVec, StoredIndex, VecIterator,
|
||||
AnyCollectableVec, CloneableAnyIterableVec, Computation, ComputedVec, ComputedVecFrom1,
|
||||
ComputedVecFrom2, EagerVec, Format, StoredIndex, VecIterator,
|
||||
};
|
||||
|
||||
use crate::vecs::indexes;
|
||||
|
||||
const VERSION: Version = Version::ZERO;
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -95,7 +97,7 @@ impl Vecs {
|
||||
version: Version,
|
||||
indexer: &Indexer,
|
||||
computation: Computation,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
) -> color_eyre::Result<Self> {
|
||||
fs::create_dir_all(path)?;
|
||||
|
||||
@@ -104,7 +106,7 @@ impl Vecs {
|
||||
path,
|
||||
"outputindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().outputindex_to_value.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -114,7 +116,7 @@ impl Vecs {
|
||||
path,
|
||||
"inputindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().inputindex_to_outputindex.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -124,7 +126,7 @@ impl Vecs {
|
||||
path,
|
||||
"txindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().txindex_to_txid.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -134,7 +136,7 @@ impl Vecs {
|
||||
path,
|
||||
"input_count",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().txindex_to_first_inputindex.boxed_clone(),
|
||||
indexer.vecs().inputindex_to_outputindex.boxed_clone(),
|
||||
|index: TxIndex, txindex_to_first_inputindex_iter, inputindex_to_outputindex_iter| {
|
||||
@@ -157,7 +159,7 @@ impl Vecs {
|
||||
path,
|
||||
"output_count",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().txindex_to_first_outputindex.boxed_clone(),
|
||||
indexer.vecs().outputindex_to_value.boxed_clone(),
|
||||
|index: TxIndex, txindex_to_first_outputindex_iter, outputindex_to_value_iter| {
|
||||
@@ -180,7 +182,7 @@ impl Vecs {
|
||||
path,
|
||||
"p2pk33index",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().p2pk33index_to_p2pk33bytes.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -189,7 +191,7 @@ impl Vecs {
|
||||
path,
|
||||
"p2pk65index",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().p2pk65index_to_p2pk65bytes.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -198,7 +200,7 @@ impl Vecs {
|
||||
path,
|
||||
"p2pkhindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().p2pkhindex_to_p2pkhbytes.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -207,7 +209,7 @@ impl Vecs {
|
||||
path,
|
||||
"p2shindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().p2shindex_to_p2shbytes.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -216,7 +218,7 @@ impl Vecs {
|
||||
path,
|
||||
"p2trindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().p2trindex_to_p2trbytes.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -225,7 +227,7 @@ impl Vecs {
|
||||
path,
|
||||
"p2wpkhindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().p2wpkhindex_to_p2wpkhbytes.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -234,7 +236,7 @@ impl Vecs {
|
||||
path,
|
||||
"p2wshindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().p2wshindex_to_p2wshbytes.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -243,7 +245,7 @@ impl Vecs {
|
||||
path,
|
||||
"p2aindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().p2aindex_to_p2abytes.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -252,7 +254,7 @@ impl Vecs {
|
||||
path,
|
||||
"p2msindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().p2msindex_to_txindex.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -261,7 +263,7 @@ impl Vecs {
|
||||
path,
|
||||
"emptyoutputindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().emptyoutputindex_to_txindex.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -270,7 +272,7 @@ impl Vecs {
|
||||
path,
|
||||
"unknownoutputindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().unknownoutputindex_to_txindex.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -279,7 +281,7 @@ impl Vecs {
|
||||
path,
|
||||
"opreturnindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().opreturnindex_to_txindex.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -288,7 +290,7 @@ impl Vecs {
|
||||
path,
|
||||
"first_height",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?;
|
||||
|
||||
let dateindex_to_dateindex = ComputedVec::forced_import_or_init_from_1(
|
||||
@@ -296,7 +298,7 @@ impl Vecs {
|
||||
path,
|
||||
"dateindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
dateindex_to_first_height.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -306,20 +308,20 @@ impl Vecs {
|
||||
path,
|
||||
"date",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
dateindex_to_dateindex.boxed_clone(),
|
||||
|index, _| Some(Date::from(index)),
|
||||
)?;
|
||||
|
||||
let height_to_date =
|
||||
EagerVec::forced_import(path, "date", version + VERSION + Version::ZERO, compressed)?;
|
||||
EagerVec::forced_import(path, "date", version + VERSION + Version::ZERO, format)?;
|
||||
|
||||
let height_to_height = ComputedVec::forced_import_or_init_from_1(
|
||||
computation,
|
||||
path,
|
||||
"height",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
height_to_date.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -329,7 +331,7 @@ impl Vecs {
|
||||
path,
|
||||
"difficultyepoch",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
height_to_height.boxed_clone(),
|
||||
|index, _| Some(DifficultyEpoch::from(index)),
|
||||
)?;
|
||||
@@ -338,7 +340,7 @@ impl Vecs {
|
||||
path,
|
||||
"first_height",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?;
|
||||
|
||||
let difficultyepoch_to_difficultyepoch = ComputedVec::forced_import_or_init_from_1(
|
||||
@@ -346,7 +348,7 @@ impl Vecs {
|
||||
path,
|
||||
"difficultyepoch",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
difficultyepoch_to_first_height.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -356,7 +358,7 @@ impl Vecs {
|
||||
path,
|
||||
"halvingepoch",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
height_to_height.boxed_clone(),
|
||||
|index, _| Some(HalvingEpoch::from(index)),
|
||||
)?;
|
||||
@@ -365,7 +367,7 @@ impl Vecs {
|
||||
path,
|
||||
"first_height",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?;
|
||||
|
||||
let halvingepoch_to_halvingepoch = ComputedVec::forced_import_or_init_from_1(
|
||||
@@ -373,23 +375,19 @@ impl Vecs {
|
||||
path,
|
||||
"halvingepoch",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
halvingepoch_to_first_height.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
|
||||
let dateindex_to_weekindex = EagerVec::forced_import(
|
||||
path,
|
||||
"weekindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
)?;
|
||||
let dateindex_to_weekindex =
|
||||
EagerVec::forced_import(path, "weekindex", version + VERSION + Version::ZERO, format)?;
|
||||
|
||||
let weekindex_to_first_dateindex = EagerVec::forced_import(
|
||||
path,
|
||||
"first_dateindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?;
|
||||
|
||||
let weekindex_to_weekindex = ComputedVec::forced_import_or_init_from_1(
|
||||
@@ -397,7 +395,7 @@ impl Vecs {
|
||||
path,
|
||||
"weekindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
weekindex_to_first_dateindex.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -406,14 +404,14 @@ impl Vecs {
|
||||
path,
|
||||
"monthindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?;
|
||||
|
||||
let monthindex_to_first_dateindex = EagerVec::forced_import(
|
||||
path,
|
||||
"first_dateindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?;
|
||||
|
||||
let monthindex_to_monthindex = ComputedVec::forced_import_or_init_from_1(
|
||||
@@ -421,7 +419,7 @@ impl Vecs {
|
||||
path,
|
||||
"monthindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
monthindex_to_first_dateindex.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -431,7 +429,7 @@ impl Vecs {
|
||||
path,
|
||||
"quarterindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
monthindex_to_monthindex.boxed_clone(),
|
||||
|index, _| Some(QuarterIndex::from(index)),
|
||||
)?;
|
||||
@@ -440,7 +438,7 @@ impl Vecs {
|
||||
path,
|
||||
"first_monthindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?;
|
||||
|
||||
let quarterindex_to_quarterindex = ComputedVec::forced_import_or_init_from_1(
|
||||
@@ -448,7 +446,7 @@ impl Vecs {
|
||||
path,
|
||||
"quarterindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
quarterindex_to_first_monthindex.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -458,7 +456,7 @@ impl Vecs {
|
||||
path,
|
||||
"yearindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
monthindex_to_monthindex.boxed_clone(),
|
||||
|index, _| Some(YearIndex::from(index)),
|
||||
)?;
|
||||
@@ -467,7 +465,7 @@ impl Vecs {
|
||||
path,
|
||||
"first_monthindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?;
|
||||
|
||||
let yearindex_to_yearindex = ComputedVec::forced_import_or_init_from_1(
|
||||
@@ -475,7 +473,7 @@ impl Vecs {
|
||||
path,
|
||||
"yearindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
yearindex_to_first_monthindex.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -485,7 +483,7 @@ impl Vecs {
|
||||
path,
|
||||
"decadeindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
yearindex_to_yearindex.boxed_clone(),
|
||||
|index, _| Some(DecadeIndex::from(index)),
|
||||
)?;
|
||||
@@ -494,7 +492,7 @@ impl Vecs {
|
||||
path,
|
||||
"first_yearindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?;
|
||||
|
||||
let decadeindex_to_decadeindex = ComputedVec::forced_import_or_init_from_1(
|
||||
@@ -502,7 +500,7 @@ impl Vecs {
|
||||
path,
|
||||
"decadeindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
decadeindex_to_first_yearindex.boxed_clone(),
|
||||
|index, _| Some(index),
|
||||
)?;
|
||||
@@ -555,79 +553,79 @@ impl Vecs {
|
||||
path,
|
||||
"date_fixed",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
height_to_dateindex: EagerVec::forced_import(
|
||||
path,
|
||||
"dateindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
txindex_to_height: EagerVec::forced_import(
|
||||
path,
|
||||
"height",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
height_to_timestamp_fixed: EagerVec::forced_import(
|
||||
path,
|
||||
"timestamp_fixed",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
height_to_txindex_count: EagerVec::forced_import(
|
||||
path,
|
||||
"txindex_count",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
dateindex_to_height_count: EagerVec::forced_import(
|
||||
path,
|
||||
"height_count",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
weekindex_to_dateindex_count: EagerVec::forced_import(
|
||||
path,
|
||||
"dateindex_count",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
difficultyepoch_to_height_count: EagerVec::forced_import(
|
||||
path,
|
||||
"height_count",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
monthindex_to_dateindex_count: EagerVec::forced_import(
|
||||
path,
|
||||
"dateindex_count",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
quarterindex_to_monthindex_count: EagerVec::forced_import(
|
||||
path,
|
||||
"monthindex_count",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
yearindex_to_monthindex_count: EagerVec::forced_import(
|
||||
path,
|
||||
"monthindex_count",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
decadeindex_to_yearindex_count: EagerVec::forced_import(
|
||||
path,
|
||||
"yearindex_count",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
outputindex_to_txindex: EagerVec::forced_import(
|
||||
path,
|
||||
"txindex",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
})
|
||||
}
|
||||
@@ -1111,6 +1109,26 @@ pub struct Indexes {
|
||||
pub halvingepoch: HalvingEpoch,
|
||||
}
|
||||
|
||||
impl Indexes {
|
||||
pub fn update_from_height(&mut self, height: Height, indexes: &indexes::Vecs) {
|
||||
self.indexes.height = height;
|
||||
self.dateindex = DateIndex::try_from(
|
||||
indexes
|
||||
.height_to_date_fixed
|
||||
.into_iter()
|
||||
.unwrap_get_inner(height),
|
||||
)
|
||||
.unwrap();
|
||||
self.weekindex = WeekIndex::from(self.dateindex);
|
||||
self.monthindex = MonthIndex::from(self.dateindex);
|
||||
self.quarterindex = QuarterIndex::from(self.monthindex);
|
||||
self.yearindex = YearIndex::from(self.monthindex);
|
||||
self.decadeindex = DecadeIndex::from(self.dateindex);
|
||||
self.difficultyepoch = DifficultyEpoch::from(self.height);
|
||||
self.halvingepoch = HalvingEpoch::from(self.height);
|
||||
}
|
||||
}
|
||||
|
||||
impl Deref for Indexes {
|
||||
type Target = brk_indexer::Indexes;
|
||||
fn deref(&self) -> &Self::Target {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ use std::{fs, path::Path};
|
||||
use brk_core::{DifficultyEpoch, HalvingEpoch, StoredF64, Version};
|
||||
use brk_exit::Exit;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{AnyCollectableVec, Compressed, Computation, VecIterator};
|
||||
use brk_vec::{AnyCollectableVec, Computation, Format, VecIterator};
|
||||
|
||||
use super::{
|
||||
Indexes,
|
||||
@@ -25,7 +25,7 @@ impl Vecs {
|
||||
path: &Path,
|
||||
version: Version,
|
||||
_computation: Computation,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
) -> color_eyre::Result<Self> {
|
||||
fs::create_dir_all(path)?;
|
||||
|
||||
@@ -35,7 +35,7 @@ impl Vecs {
|
||||
"difficulty",
|
||||
false,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_last(),
|
||||
)?,
|
||||
indexes_to_difficultyepoch: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -43,7 +43,7 @@ impl Vecs {
|
||||
"difficultyepoch",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_last(),
|
||||
)?,
|
||||
indexes_to_halvingepoch: ComputedVecsFromDateIndex::forced_import(
|
||||
@@ -51,7 +51,7 @@ impl Vecs {
|
||||
"halvingepoch",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_last(),
|
||||
)?,
|
||||
})
|
||||
|
||||
@@ -4,7 +4,7 @@ use brk_core::Version;
|
||||
use brk_exit::Exit;
|
||||
use brk_fetcher::Fetcher;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{AnyCollectableVec, Compressed, Computation};
|
||||
use brk_vec::{AnyCollectableVec, Computation, Format};
|
||||
use fjall::TransactionalKeyspace;
|
||||
|
||||
pub mod blocks;
|
||||
@@ -40,7 +40,7 @@ impl Vecs {
|
||||
indexer: &Indexer,
|
||||
fetch: bool,
|
||||
computation: Computation,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
keyspace: &TransactionalKeyspace,
|
||||
) -> color_eyre::Result<Self> {
|
||||
fs::create_dir_all(path)?;
|
||||
@@ -50,7 +50,7 @@ impl Vecs {
|
||||
version + VERSION + Version::ZERO,
|
||||
indexer,
|
||||
computation,
|
||||
compressed,
|
||||
format,
|
||||
)?;
|
||||
|
||||
let fetched = fetch.then(|| {
|
||||
@@ -58,7 +58,7 @@ impl Vecs {
|
||||
path,
|
||||
version + VERSION + Version::ZERO,
|
||||
computation,
|
||||
compressed,
|
||||
format,
|
||||
)
|
||||
.unwrap()
|
||||
});
|
||||
@@ -68,31 +68,31 @@ impl Vecs {
|
||||
path,
|
||||
version + VERSION + Version::ZERO,
|
||||
computation,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
mining: mining::Vecs::forced_import(
|
||||
path,
|
||||
version + VERSION + Version::ZERO,
|
||||
computation,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
constants: constants::Vecs::forced_import(
|
||||
path,
|
||||
version + VERSION + Version::ZERO,
|
||||
computation,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
market: market::Vecs::forced_import(
|
||||
path,
|
||||
version + VERSION + Version::ZERO,
|
||||
computation,
|
||||
compressed,
|
||||
format,
|
||||
)?,
|
||||
stateful: stateful::Vecs::forced_import(
|
||||
path,
|
||||
version + VERSION + Version::ZERO,
|
||||
computation,
|
||||
compressed,
|
||||
format,
|
||||
fetched.as_ref(),
|
||||
keyspace,
|
||||
)?,
|
||||
@@ -102,7 +102,7 @@ impl Vecs {
|
||||
indexer,
|
||||
&indexes,
|
||||
computation,
|
||||
compressed,
|
||||
format,
|
||||
fetched.as_ref(),
|
||||
)?,
|
||||
indexes,
|
||||
@@ -162,7 +162,8 @@ impl Vecs {
|
||||
&self.indexes,
|
||||
&self.transactions,
|
||||
self.fetched.as_ref(),
|
||||
&starting_indexes,
|
||||
&self.market,
|
||||
starting_indexes,
|
||||
exit,
|
||||
)?;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,16 +1,20 @@
|
||||
use std::{collections::BTreeMap, ops::ControlFlow};
|
||||
|
||||
use brk_core::{CheckedSub, Dollars, HalvingEpoch, Height, Timestamp};
|
||||
use brk_core::{CheckedSub, Dollars, HalvingEpoch, Height, Result, Timestamp};
|
||||
use brk_exit::Exit;
|
||||
use brk_state::{BlockState, OutputFilter, Outputs, Transacted};
|
||||
use brk_vec::StoredIndex;
|
||||
use rayon::prelude::*;
|
||||
|
||||
use crate::vecs::Indexes;
|
||||
|
||||
use super::cohort;
|
||||
|
||||
pub trait OutputCohorts {
|
||||
fn tick_tock_next_block(&mut self, chain_state: &[BlockState], timestamp: Timestamp);
|
||||
fn send(&mut self, height_to_sent: BTreeMap<Height, Transacted>, chain_state: &[BlockState]);
|
||||
fn receive(&mut self, received: Transacted, height: Height, price: Option<Dollars>);
|
||||
fn compute_overlaping_vecs(&mut self, starting_indexes: &Indexes, exit: &Exit) -> Result<()>;
|
||||
}
|
||||
|
||||
impl OutputCohorts for Outputs<(OutputFilter, cohort::Vecs)> {
|
||||
@@ -21,27 +25,12 @@ impl OutputCohorts for Outputs<(OutputFilter, cohort::Vecs)> {
|
||||
|
||||
let prev_timestamp = chain_state.last().unwrap().timestamp;
|
||||
|
||||
self.by_term
|
||||
self.by_date_range
|
||||
.as_mut_vec()
|
||||
.into_par_iter()
|
||||
.chain(self.by_up_to.as_mut_vec())
|
||||
.chain(self.by_from.as_mut_vec())
|
||||
.chain(self.by_range.as_mut_vec())
|
||||
.for_each(|(filter, v)| {
|
||||
let state = &mut v.state;
|
||||
|
||||
let mut check_days_old = |days_old: usize| -> bool {
|
||||
match filter {
|
||||
OutputFilter::From(from) => *from <= days_old,
|
||||
OutputFilter::To(to) => *to > days_old,
|
||||
OutputFilter::Range(range) => range.contains(&days_old),
|
||||
OutputFilter::All
|
||||
| OutputFilter::Epoch(_)
|
||||
| OutputFilter::Size
|
||||
| OutputFilter::Type(_) => unreachable!(),
|
||||
}
|
||||
};
|
||||
|
||||
let _ = chain_state
|
||||
.iter()
|
||||
.try_for_each(|block_state| -> ControlFlow<()> {
|
||||
@@ -54,8 +43,8 @@ impl OutputCohorts for Outputs<(OutputFilter, cohort::Vecs)> {
|
||||
return ControlFlow::Continue(());
|
||||
}
|
||||
|
||||
let is = check_days_old(days_old);
|
||||
let was = check_days_old(prev_days_old);
|
||||
let is = filter.contains(days_old);
|
||||
let was = filter.contains(prev_days_old);
|
||||
|
||||
if is && !was {
|
||||
state.increment(&block_state.supply, block_state.price);
|
||||
@@ -70,12 +59,9 @@ impl OutputCohorts for Outputs<(OutputFilter, cohort::Vecs)> {
|
||||
|
||||
fn send(&mut self, height_to_sent: BTreeMap<Height, Transacted>, chain_state: &[BlockState]) {
|
||||
let mut time_based_vecs = self
|
||||
.by_term
|
||||
.by_date_range
|
||||
.as_mut_vec()
|
||||
.into_iter()
|
||||
.chain(self.by_up_to.as_mut_vec())
|
||||
.chain(self.by_from.as_mut_vec())
|
||||
.chain(self.by_range.as_mut_vec())
|
||||
.chain(self.by_epoch.as_mut_vec())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
@@ -95,13 +81,6 @@ impl OutputCohorts for Outputs<(OutputFilter, cohort::Vecs)> {
|
||||
.as_second()
|
||||
>= 60 * 60;
|
||||
|
||||
self.all.1.state.send(
|
||||
&sent.spendable_supply,
|
||||
current_price,
|
||||
prev_price,
|
||||
older_than_hour,
|
||||
);
|
||||
|
||||
time_based_vecs
|
||||
.iter_mut()
|
||||
.filter(|(filter, _)| match filter {
|
||||
@@ -131,14 +110,16 @@ impl OutputCohorts for Outputs<(OutputFilter, cohort::Vecs)> {
|
||||
},
|
||||
);
|
||||
|
||||
sent.by_size.into_iter().for_each(|(group, supply_state)| {
|
||||
self.by_size.get_mut(group).1.state.send(
|
||||
&supply_state,
|
||||
current_price,
|
||||
prev_price,
|
||||
older_than_hour,
|
||||
);
|
||||
});
|
||||
sent.by_size_group
|
||||
.into_iter()
|
||||
.for_each(|(group, supply_state)| {
|
||||
self.by_size_range.get_mut(group).1.state.send(
|
||||
&supply_state,
|
||||
current_price,
|
||||
prev_price,
|
||||
older_than_hour,
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -146,13 +127,10 @@ impl OutputCohorts for Outputs<(OutputFilter, cohort::Vecs)> {
|
||||
let supply_state = received.spendable_supply;
|
||||
|
||||
[
|
||||
&mut self.all.1,
|
||||
&mut self.by_term.short.1,
|
||||
&mut self.by_date_range.start_to_1d.1,
|
||||
&mut self.by_epoch.mut_vec_from_height(height).1,
|
||||
// Skip from and range as can't receive in the past
|
||||
]
|
||||
.into_iter()
|
||||
.chain(self.by_up_to.as_mut_vec().map(|(_, v)| v))
|
||||
.for_each(|v| {
|
||||
v.state.receive(&supply_state, price);
|
||||
});
|
||||
@@ -169,14 +147,105 @@ impl OutputCohorts for Outputs<(OutputFilter, cohort::Vecs)> {
|
||||
});
|
||||
|
||||
received
|
||||
.by_size
|
||||
.by_size_group
|
||||
.into_iter()
|
||||
.for_each(|(group, supply_state)| {
|
||||
self.by_size
|
||||
self.by_size_range
|
||||
.get_mut(group)
|
||||
.1
|
||||
.state
|
||||
.receive(&supply_state, price);
|
||||
});
|
||||
}
|
||||
|
||||
fn compute_overlaping_vecs(&mut self, starting_indexes: &Indexes, exit: &Exit) -> Result<()> {
|
||||
self.all
|
||||
.1
|
||||
.compute_from_stateful(starting_indexes, &self.by_epoch.vecs(), exit)?;
|
||||
|
||||
self.by_from_date
|
||||
.as_mut_vec()
|
||||
.into_iter()
|
||||
.try_for_each(|(filter, vecs)| {
|
||||
vecs.compute_from_stateful(
|
||||
starting_indexes,
|
||||
self.by_date_range
|
||||
.as_vec()
|
||||
.into_iter()
|
||||
.filter(|(other, _)| filter.includes(other))
|
||||
.map(|(_, v)| v)
|
||||
.collect::<Vec<_>>()
|
||||
.as_slice(),
|
||||
exit,
|
||||
)
|
||||
})?;
|
||||
|
||||
self.by_up_to_date
|
||||
.as_mut_vec()
|
||||
.into_iter()
|
||||
.try_for_each(|(filter, vecs)| {
|
||||
vecs.compute_from_stateful(
|
||||
starting_indexes,
|
||||
self.by_date_range
|
||||
.as_vec()
|
||||
.into_iter()
|
||||
.filter(|(other, _)| filter.includes(other))
|
||||
.map(|(_, v)| v)
|
||||
.collect::<Vec<_>>()
|
||||
.as_slice(),
|
||||
exit,
|
||||
)
|
||||
})?;
|
||||
|
||||
self.by_term
|
||||
.as_mut_vec()
|
||||
.into_iter()
|
||||
.try_for_each(|(filter, vecs)| {
|
||||
vecs.compute_from_stateful(
|
||||
starting_indexes,
|
||||
self.by_date_range
|
||||
.as_vec()
|
||||
.into_iter()
|
||||
.filter(|(other, _)| filter.includes(other))
|
||||
.map(|(_, v)| v)
|
||||
.collect::<Vec<_>>()
|
||||
.as_slice(),
|
||||
exit,
|
||||
)
|
||||
})?;
|
||||
|
||||
self.by_up_to_size
|
||||
.as_mut_vec()
|
||||
.into_iter()
|
||||
.try_for_each(|(filter, vecs)| {
|
||||
vecs.compute_from_stateful(
|
||||
starting_indexes,
|
||||
self.by_date_range
|
||||
.as_vec()
|
||||
.into_iter()
|
||||
.filter(|(other, _)| filter.includes(other))
|
||||
.map(|(_, v)| v)
|
||||
.collect::<Vec<_>>()
|
||||
.as_slice(),
|
||||
exit,
|
||||
)
|
||||
})?;
|
||||
|
||||
self.by_from_size
|
||||
.as_mut_vec()
|
||||
.into_iter()
|
||||
.try_for_each(|(filter, vecs)| {
|
||||
vecs.compute_from_stateful(
|
||||
starting_indexes,
|
||||
self.by_size_range
|
||||
.as_vec()
|
||||
.into_iter()
|
||||
.filter(|(other, _)| filter.includes(other))
|
||||
.map(|(_, v)| v)
|
||||
.collect::<Vec<_>>()
|
||||
.as_slice(),
|
||||
exit,
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ use brk_core::{
|
||||
use brk_exit::Exit;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{
|
||||
AnyCollectableVec, AnyIterableVec, CloneableAnyIterableVec, Compressed, Computation,
|
||||
ComputedVec, ComputedVecFrom1, ComputedVecFrom2, ComputedVecFrom3, StoredIndex, VecIterator,
|
||||
AnyCollectableVec, AnyIterableVec, CloneableAnyIterableVec, Computation, ComputedVec,
|
||||
ComputedVecFrom1, ComputedVecFrom2, ComputedVecFrom3, Format, StoredIndex, VecIterator,
|
||||
};
|
||||
|
||||
use super::{
|
||||
@@ -93,7 +93,7 @@ impl Vecs {
|
||||
indexer: &Indexer,
|
||||
indexes: &indexes::Vecs,
|
||||
computation: Computation,
|
||||
compressed: Compressed,
|
||||
format: Format,
|
||||
fetched: Option<&fetched::Vecs>,
|
||||
) -> color_eyre::Result<Self> {
|
||||
let compute_dollars = fetched.is_some();
|
||||
@@ -105,7 +105,7 @@ impl Vecs {
|
||||
path,
|
||||
"value",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().inputindex_to_outputindex.boxed_clone(),
|
||||
indexer.vecs().outputindex_to_value.boxed_clone(),
|
||||
|index: InputIndex, inputindex_to_outputindex_iter, outputindex_to_value_iter| {
|
||||
@@ -132,7 +132,7 @@ impl Vecs {
|
||||
path,
|
||||
"weight",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().txindex_to_base_size.boxed_clone(),
|
||||
indexer.vecs().txindex_to_total_size.boxed_clone(),
|
||||
|index: TxIndex, txindex_to_base_size_iter, txindex_to_total_size_iter| {
|
||||
@@ -160,7 +160,7 @@ impl Vecs {
|
||||
path,
|
||||
"vsize",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
txindex_to_weight.boxed_clone(),
|
||||
|index: TxIndex, iter| {
|
||||
let index = index.unwrap_to_usize();
|
||||
@@ -177,7 +177,7 @@ impl Vecs {
|
||||
path,
|
||||
"is_coinbase",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexes.txindex_to_height.boxed_clone(),
|
||||
indexer.vecs().height_to_first_txindex.boxed_clone(),
|
||||
|index: TxIndex, txindex_to_height_iter, height_to_first_txindex_iter| {
|
||||
@@ -201,7 +201,7 @@ impl Vecs {
|
||||
path,
|
||||
"input_value",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().txindex_to_first_inputindex.boxed_clone(),
|
||||
indexes.txindex_to_input_count.boxed_clone(),
|
||||
inputindex_to_value.boxed_clone(),
|
||||
@@ -238,7 +238,7 @@ impl Vecs {
|
||||
// "input_value",
|
||||
// true,
|
||||
// version + VERSION + Version::ZERO,
|
||||
// compressed,
|
||||
// format,
|
||||
// StorableVecGeneatorOptions::default()
|
||||
// .add_average()
|
||||
// .add_sum()
|
||||
@@ -250,7 +250,7 @@ impl Vecs {
|
||||
path,
|
||||
"output_value",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
indexer.vecs().txindex_to_first_outputindex.boxed_clone(),
|
||||
indexes.txindex_to_output_count.boxed_clone(),
|
||||
indexer.vecs().outputindex_to_value.boxed_clone(),
|
||||
@@ -287,7 +287,7 @@ impl Vecs {
|
||||
// "output_value",
|
||||
// true,
|
||||
// version + VERSION + Version::ZERO,
|
||||
// compressed,
|
||||
// format,
|
||||
// StorableVecGeneatorOptions::default()
|
||||
// .add_average()
|
||||
// .add_sum()
|
||||
@@ -299,7 +299,7 @@ impl Vecs {
|
||||
path,
|
||||
"fee",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
txindex_to_input_value.boxed_clone(),
|
||||
txindex_to_output_value.boxed_clone(),
|
||||
|txindex: TxIndex, input_iter, output_iter| {
|
||||
@@ -322,7 +322,7 @@ impl Vecs {
|
||||
path,
|
||||
"feerate",
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
txindex_to_fee.boxed_clone(),
|
||||
txindex_to_vsize.boxed_clone(),
|
||||
|txindex: TxIndex, fee_iter, vsize_iter| {
|
||||
@@ -343,7 +343,7 @@ impl Vecs {
|
||||
"tx_count",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
@@ -356,7 +356,7 @@ impl Vecs {
|
||||
"input_count",
|
||||
false,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
@@ -369,7 +369,7 @@ impl Vecs {
|
||||
"output_count",
|
||||
false,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
@@ -382,7 +382,7 @@ impl Vecs {
|
||||
"tx_v1",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_sum()
|
||||
.add_cumulative(),
|
||||
@@ -392,7 +392,7 @@ impl Vecs {
|
||||
"tx_v2",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_sum()
|
||||
.add_cumulative(),
|
||||
@@ -402,7 +402,7 @@ impl Vecs {
|
||||
"tx_v3",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_sum()
|
||||
.add_cumulative(),
|
||||
@@ -414,7 +414,7 @@ impl Vecs {
|
||||
Some(txindex_to_fee.boxed_clone()),
|
||||
version + VERSION + Version::ZERO,
|
||||
computation,
|
||||
compressed,
|
||||
format,
|
||||
fetched,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_sum()
|
||||
@@ -428,7 +428,7 @@ impl Vecs {
|
||||
"feerate",
|
||||
false,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_percentiles()
|
||||
.add_minmax()
|
||||
@@ -439,7 +439,7 @@ impl Vecs {
|
||||
"tx_vsize",
|
||||
false,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_percentiles()
|
||||
.add_minmax()
|
||||
@@ -450,7 +450,7 @@ impl Vecs {
|
||||
"tx_weight",
|
||||
false,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_percentiles()
|
||||
.add_minmax()
|
||||
@@ -461,7 +461,7 @@ impl Vecs {
|
||||
"subsidy",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_percentiles()
|
||||
.add_sum()
|
||||
@@ -475,7 +475,7 @@ impl Vecs {
|
||||
"coinbase",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_sum()
|
||||
.add_cumulative()
|
||||
@@ -489,7 +489,7 @@ impl Vecs {
|
||||
"unclaimed_rewards",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_sum()
|
||||
.add_cumulative(),
|
||||
@@ -500,7 +500,7 @@ impl Vecs {
|
||||
"p2a_count",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
@@ -513,7 +513,7 @@ impl Vecs {
|
||||
"p2ms_count",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
@@ -526,7 +526,7 @@ impl Vecs {
|
||||
"p2pk33_count",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
@@ -539,7 +539,7 @@ impl Vecs {
|
||||
"p2pk65_count",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
@@ -552,7 +552,7 @@ impl Vecs {
|
||||
"p2pkh_count",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
@@ -565,7 +565,7 @@ impl Vecs {
|
||||
"p2sh_count",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
@@ -578,7 +578,7 @@ impl Vecs {
|
||||
"p2tr_count",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
@@ -591,7 +591,7 @@ impl Vecs {
|
||||
"p2wpkh_count",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
@@ -604,7 +604,7 @@ impl Vecs {
|
||||
"p2wsh_count",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
@@ -617,7 +617,7 @@ impl Vecs {
|
||||
"opreturn_count",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
@@ -630,7 +630,7 @@ impl Vecs {
|
||||
"unknownoutput_count",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
@@ -643,7 +643,7 @@ impl Vecs {
|
||||
"emptyoutput_count",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
@@ -656,7 +656,7 @@ impl Vecs {
|
||||
"exact_utxo_count",
|
||||
true,
|
||||
version + VERSION + Version::ZERO,
|
||||
compressed,
|
||||
format,
|
||||
StorableVecGeneatorOptions::default().add_last(),
|
||||
)?,
|
||||
txindex_to_is_coinbase,
|
||||
|
||||
Reference in New Issue
Block a user