https://github.com/tradle/tx-walker
an easier way to consume bitcoin blocks and transactions
https://github.com/tradle/tx-walker
Last synced: about 2 months ago
JSON representation
an easier way to consume bitcoin blocks and transactions
- Host: GitHub
- URL: https://github.com/tradle/tx-walker
- Owner: tradle
- License: mit
- Created: 2015-02-04T15:23:08.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-21T17:36:34.000Z (almost 11 years ago)
- Last Synced: 2025-02-28T14:42:14.868Z (over 1 year ago)
- Language: JavaScript
- Size: 258 KB
- Stars: 2
- Watchers: 9
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#Usage
var Walker = require('tx-walker')
var walker = new Walker({
networkName: 'bitcoin', // optional, defaults to 'bitcoin'
batchSize: 20, // optional, defaults to 20
throttle: 2000 // optional, defaults to 2000
})
var numBlocks = 0
walker.start(100000) // block height
walker.on('block', function(block) {
// i want to do bad things to block
});
walker.on('tx', function(tx) {
// i want to do bad things to tx
});
// emitted after the last 'tx' event of a block, unless the walker is stopped in the middle of the block
walker.on('blockend', function() {
if (++numBlocks === 10) walker.stop()
})