Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bitcoinjs/blkdat-stream
A blk*.dat streaming module, useful for parsing the Bitcoin blockchain
https://github.com/bitcoinjs/blkdat-stream
Last synced: 3 months ago
JSON representation
A blk*.dat streaming module, useful for parsing the Bitcoin blockchain
- Host: GitHub
- URL: https://github.com/bitcoinjs/blkdat-stream
- Owner: bitcoinjs
- License: mit
- Created: 2015-03-25T00:44:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-09T12:07:23.000Z (over 8 years ago)
- Last Synced: 2024-04-14T10:50:38.246Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 14
- Watchers: 11
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cryptocoinjs - bitcoin
README
# blkdat-stream
[![Version](http://img.shields.io/npm/v/blkdat-stream.svg)](https://www.npmjs.org/package/blkdat-stream)
A lite blk\*.dat streaming module, useful for parsing the Bitcoin blockchain
**Note**: For a high performance C++ parser, see https://github.com/dcousens/fast-dat-parser
### Example
``` javascript
// usage: cat blk*.dat | node this.jsvar BlockStream = require('blkdat-stream')
var blockStream = new BlockStream() // for testnet3: new BlockStream(0x0709110b)process.stdin.pipe(new BlockStream()).on('data', function (blockBuffer) {
// ... now, parse the block data buffer (is an atomic block)
})
```To parse the returned block data, use a library such as [bitcoinjs-lib](https://github.com/bitcoinjs/bitcoinjs-lib) or [bitcore](https://github.com/bitpay/bitcore).