Expand description

Blocks Iterator

Read bitcoin blocks directory containing blocks*.dat files, and produce a ordered stream of BlockExtra

Re-exports

pub use bitcoin;
pub use fxhash;
pub use glob;
pub use log;
pub use structopt;

Structs

The bitcoin block and additional metadata returned by the [iterate] method

Configuration parameters, most important the bitcoin blocks directory

Before reorder we keep only the position of the block in the file system and data relative to the block hash, the previous hash and the following hash (populated during reorder phase) We will need to read the block from disk again, but by doing so we will avoid using too much memory in the [OutOfOrderBlocks] map.

Contains counter and instants to provide per period stats over transaction and blocks processed

Utility used to return true after period

Iterator to use un Unix-style pipe composition when receiving BlockExtra from stdin and propogating those to stdout

Functions

Return an Iterator of BlockExtra read from blocks*.dat contained in the config.blocks_dir Blocks returned are iterated in order, starting from the genesis to the highest block (minus config.max_reorg) in the directory, unless config.stop_at_height is specified.

Read blocks*.dat contained in the config.blocks_dir directory and returns BlockExtra through a channel supplied from the caller. Blocks returned are ordered from the genesis to the highest block in the directory (minus config.max_reorg). In this call threads are spawned, caller must call std::thread::JoinHandle::join on the returning handle.

Utility method usually returning log::Level::Debug but when i is divisible by every returns log::Level::Info