blk-reader 0.1.0

Fast reader for Bitcoin Core blk*.dat files with automatic XOR decoding (Bitcoin Core 28.0+)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[derive(Debug, thiserror::Error)]
pub enum BlkReaderError {
    #[error("Failed to open LevelDB at {path}: {reason}")]
    LevelDbOpen { path: std::path::PathBuf, reason: String },

    #[error("Error parsing index entry: {reason}")]
    IndexParseError { reason: String },

    #[error("File blk{index:05}.dat not found")]
    BlkFileNotFound { index: u32 },

    #[error("Invalid magic bytes in file {file}, offset {offset}: expected 0xD9B4BEF9, got {got:#010x}")]
    InvalidMagicBytes { file: u32, offset: u64, got: u32 },

    #[error("I/O error: {0}")]
    Io(#[from] std::io::Error),
}