You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

elasticsearch-blockchain

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elasticsearch-blockchain

Load the bitcoin blockchain data into an elasticsearch index

0.0.3
latest
Source
npmnpm
Version published
Weekly downloads
1
-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

elasticsearch-blockchain

This node script queries your bitcoin-core client via RPC and inserts data into an elasticsearch index.

Prerequisites

  • A fully synced bitcoin-core client.
  • A running ElasticSearch node Note that the Elasticsearch index size is ~220GB when the process completes.

How does it work?

  • getLastHeight() will check if an index named blocks already exists in your elasticsearch instance.
  • If the index does not exist, it will return 0 to the run() function which will start the data gathering. If the index already exists it will query it to get the last inserted block height and will pass that value to run() so the process will continue where it was last stopped.
  • Data is pulled via the bitcoin-core RPC in the following manner:
  • Run getBlockHash() with the current block height.
  • Run getBlock() with the result.
  • Iterate through all block transactions and get getRawTransction() .
  • Get the TX information by running decodeRawTransaction().
  • All trnasaction details for the given block are then flattened into block information under block.txinfo.

Keywords

blockchain

FAQs

Package last updated on 13 Jan 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