blockcast-state-engine
Scan the Bitcoin blockchain for an ordered list of Blockcast data.
npm install blockcast-state-engine
var RpcClient = require('bitcoind-rpc')
var rpcCommonBlockchain = require('rpc-common-blockchain')
var config = {
protocol: 'http',
user: 'rpcuser',
pass: 'rpcpassword',
host: '127.0.0.1',
port: '18332'
}
var rpc = new RpcClient(config)
var commonBlockchain = rpcCommonBlockchain({
rpc: rpc
})
var blockcastStateEngine = require('blockcast-state-engine')({
commonBlockchain: commonBlockchain
})
blockcastStateEngine.scanFrom({
blockHeight: 572949,
toBlockHeight: 572952,
onBlock: function (err, blockInfo) {},
onFound: function (err, blockInfo) {}
}, function (err, blockcasts) {
console.log(blockcast[0])
{
index: 1,
blockId: '0000000000003585e8d4a23ec784dc845f28cc8bc0950fc68a6bc5863a10f578',
tx: {},
data: 'fTmp34KdrUApes4Ro4NpSUpR4gItC0',
addresses: [ 'msLoJikUfxbc2U5UhRSjc2svusBSqMdqxZ' ]
}
})