Struct blocks_iterator::Config
source · pub struct Config {
pub blocks_dir: PathBuf,
pub network: Network,
pub skip_prevout: bool,
pub max_reorg: u8,
pub channels_size: u8,
pub start_at_height: u32,
pub stop_at_height: Option<u32>,
}
Expand description
Configuration parameters, most important the bitcoin blocks directory
Fields§
§blocks_dir: PathBuf
Blocks directory (containing blocks*.dat
)
network: Network
Network (bitcoin, testnet, regtest, signet)
skip_prevout: bool
Skip calculation of previous outputs, it’s faster and it uses much less memory however make it impossible calculate fees or access tx input previous scripts
max_reorg: u8
Maximum length of a reorg allowed, during reordering send block to the next step only
if it has max_reorg
following blocks. Higher is more conservative, while lower faster.
When parsing testnet blocks, it may be necessary to increase this a lot
channels_size: u8
Size of the channels used to pass messages between threads
start_at_height: u32
Start the blocks iteration at the specified height, note blocks*.dat file are read and analyzed anyway to follow the blockchain starting at the genesis and populate utxos, however they are not emitted
stop_at_height: Option<u32>
Stop the blocks iteration at the specified height
Implementations§
Trait Implementations§
source§impl StructOpt for Config
impl StructOpt for Config
source§fn from_clap(matches: &ArgMatches<'_>) -> Self
fn from_clap(matches: &ArgMatches<'_>) -> Self
clap::ArgMatches
. It’s guaranteed to succeed
if matches
originates from an App
generated by StructOpt::clap
called on
the same type, otherwise it must panic.source§fn from_args() -> Selfwhere
Self: Sized,
fn from_args() -> Selfwhere Self: Sized,
std::env::args_os
).
Calls clap::Error::exit
on failure, printing the error message and aborting the program.source§fn from_args_safe() -> Result<Self, Error>where
Self: Sized,
fn from_args_safe() -> Result<Self, Error>where Self: Sized,
std::env::args_os
).
Unlike StructOpt::from_args
, returns clap::Error
on failure instead of aborting the program,
so calling .exit
is up to you.source§fn from_iter<I>(iter: I) -> Selfwhere
Self: Sized,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString> + Clone,
fn from_iter<I>(iter: I) -> Selfwhere Self: Sized, I: IntoIterator, <I as IntoIterator>::Item: Into<OsString> + Clone,
Vec
of your making.
Print the error message and quit the program in case of failure. Read moresource§fn from_iter_safe<I>(iter: I) -> Result<Self, Error>where
Self: Sized,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString> + Clone,
fn from_iter_safe<I>(iter: I) -> Result<Self, Error>where Self: Sized, I: IntoIterator, <I as IntoIterator>::Item: Into<OsString> + Clone,
Vec
of your making. Read more