elasticsearch-blockchain

0.0.3 • Public • Published

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.

Package Sidebar

Install

npm i elasticsearch-blockchain

Weekly Downloads

2

Version

0.0.3

License

MIT

Last publish

Collaborators

  • orweinberger