Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

blockcast-state-engine

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blockcast-state-engine

Blockcast State Engine

  • 1.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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, // scan the four blocks from 572949 to 572952
  toBlockHeight: 572952,
  onBlock: function (err, blockInfo) {}, // callback on every block, contains full blockHex
  onFound: function (err, blockInfo) {}  // callback on every block found with blockcasts, includes list of blockcasts
}, function (err, blockcasts) {
  console.log(blockcast[0])
  { 
    index: 1, // the index of the transaction in the block
    blockId: '0000000000003585e8d4a23ec784dc845f28cc8bc0950fc68a6bc5863a10f578',
    tx: {}, // detailed information about the primary transaction
    data: 'fTmp34KdrUApes4Ro4NpSUpR4gItC0', // the data the was embedded
    addresses: [ 'msLoJikUfxbc2U5UhRSjc2svusBSqMdqxZ' ] 
  }
})

Keywords

FAQs

Package last updated on 23 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc