An open API service indexing awesome lists of open source software.

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

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()
})