{"repo":"RCasatta/blocks_iterator","free":true,"listed":false,"github":"https://github.com/RCasatta/blocks_iterator","clone":"git clone https://github.com/RCasatta/blocks_iterator.git","description":"Iterate over bitcoin blocks","language":"Rust","stars":65,"topics":["bitcoin","rust","blocks"],"license":"MIT","category":"blockchain-web3","readme_excerpt":"Blocks iterator Iterates over Bitcoin blocks, decoding data inside Bitcoin Core's blocks directory. Features: Blocks are returned in height order, it avoids following reorgs (see [ Config::max reorg ] parameter) Blocks come with extra data [ BlockExtra ] like all block's previous outputs, it allows computing transactions fee or verifying scripts in the blockchain. Note: Bitcoin Core 28.0 introduced xoring of bitcoin blocks and this project doesn't yet support reading the blocks directory when xored. You can disable xoring in core via -blocksxor=0 . Iteration modes In rust programs Used as a library blocks could be iterated via the [ iter() ] method like: When the task to be performed is computational costly, like verifying spending conditions, it is suggested to parallelize the execution like it's done with rayon (or similar) in the verify example (note par bridge() call). Through Pipes Other than inside Rust programs, ordered blocks with previous outputs could be iterated using Unix pipes. If you have more consumer process you can concatenate pipes by passing stdout to PipeIterator::new or using tee utility to split the stdout of blocks iterator. The latter is better because it doesn't require re-serialization of the data. Binary version When using pipes, data is serialized and deserialized. blocks iterator 1.x produce serialized BlockExtra with version 0 and read version 0. blocks iterator 2.x produce serialized BlockExtra with version 1 and read version 0 and 1. The binary","default_branch":null,"files":null,"tree":[],"storefront":"/r/RCasatta","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/RCasatta/blocks_iterator/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}