Socket
Socket
Sign inDemoInstall

elasticsearch-blockchain

Package Overview
Dependencies
80
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    elasticsearch-blockchain

Load the bitcoin blockchain data into an elasticsearch index


Version published
Weekly downloads
11
increased by450%
Maintainers
1
Install size
10.9 MB
Created
Weekly downloads
 

Readme

Source

elasticsearch-blockchain

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

Prerequisites

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

How does it work?

  1. getLastHeight() will check if an index named blocks already exists in your elasticsearch instance.
  2. 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.
  3. Data is pulled via the bitcoin-core RPC in the following manner:
  4. Run getBlockHash() with the current block height.
  5. Run getBlock() with the result.
  6. Iterate through all block transactions and get getRawTransction() .
  7. Get the TX information by running decodeRawTransaction().
  8. All trnasaction details for the given block are then flattened into block information under block.txinfo.

Keywords

FAQs

Last updated on 13 Jan 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc