Thanks to visit codestin.com
Credit goes to github.com

Skip to content

vladkens/bcloop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bcloop

A Bitcoin-like blockchain parser for local nodes, written in pure Rust. It parses raw blockchain .dat files and produces UTXO dumps in CSV format for analysis. Compatible with Bitcoin, Litecoin, Bitcoin Cash, and similar blockchains.

Features

  • Pure Rust implementation with no LevelDB dependency
  • Memory-efficient design that works on machines where UTXO HashMaps can't fit into RAM
  • Parallel processing for faster data extraction
  • Direct parsing of blockchain .dat files (ordered blocks)
  • CSV output format for easy integration with analysis tools
  • Multi-blockchain support

CLI usage

cargo install bcloop

UTXO dump

bcloop utxodump /path/to/blockchain/blocks output.csv

Library usage

cargo add bcloop
use bcloop::{BcWalker, AddrType};

// Initialize the blockchain walker
let walker = BcWalker::from_dir("/path/to/blockchain/blocks")?;

let chan = walker.get_chan();
while let Ok((blk, blk_size)) = chan.recv() {
  println!("Block {} have {} txs", block.height, block.txs.len());

  for tx in blk.txs.iter() {
    for txo in tx.outputs.iter() { /* Process txo data... */ }
    for txi in tx.inputs.iter() { /* Process txi data... */ }
  }
}

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A Bitcoin-like blockchain parser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published