2.0.0 • Published 10 years ago

bitcoind-block-stream v2.0.0

Weekly downloads
12
License
MIT
Repository
github
Last release
10 years ago

Returns a stream of blocks from given start height to given max height.

Installation

npm install bitcoind-block-stream

Example

var bitcoin = require('bitcoin')
var bs = require('./index')
var level = require('level')
var map = require('through2-map')

var client = new bitcoin.Client(require('./bitcoin.json'))
var db = level('testdb')

var ws = db.createWriteStream({ valueEncoding: 'json' })
ws.on('error', function (err) {
  console.log('Oh my!', err)
})
ws.on('close', function () {
  console.log('Stream closed')
})

bs(client, { from: 4, to: 12 })
  .pipe(map.obj(function (x) { return { key: x.hash, value: x } }))
  .pipe(ws)
2.0.0

10 years ago

1.3.2

10 years ago

1.2.2

10 years ago

1.1.2

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.0

10 years ago