{"name":"ethereumjs-blockchain","version":"0.0.0","description":"A module to store and interact with blocks","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/ethereum/ethereumjs-blockchain.git"},"keywords":["ethereum"],"author":{"name":"mjbecze","email":"mjbecze@gmail.com"},"license":"GPL-2.0","bugs":{"url":"https://github.com/ethereum/ethereumjs-blockchain/issues"},"homepage":"https://github.com/ethereum/ethereumjs-blockchain#readme","dependencies":{"ethashjs":"0.0.2","ethereumjs-block":"0.0.4","ethereumjs-util":"^1.3.6"},"gitHead":"a8a85b46e6b9f1fad5847f0e2d1ccb034bcd4b13","_id":"ethereumjs-blockchain@0.0.0","_shasum":"890bdcda6703c3991305d34784765aca93fc2fab","_from":".","_npmVersion":"2.13.2","_nodeVersion":"0.12.7","_npmUser":{"name":"null_radix","email":"mjbecze@gmail.com"},"dist":{"shasum":"890bdcda6703c3991305d34784765aca93fc2fab","tarball":"http://registry-npm.ywwl.com/ethereumjs-blockchain/download/ethereumjs-blockchain-0.0.0.tgz","integrity":"sha512-IuYyx0u7ctO3qAQY9fgTiytNZJxhAbE+BPLPAk9JXMu7j/rSIq2PVBelD4t+WCVOXGNLSHq0/8fkosCxLoliwQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtriHll0n7hBrb5Ao5V7PqUgdEzXnG73exxBg4GaQzNgIgHs8UBXVPIBw/h3zdeTELgDKzISlYWLSxwebZgHUBsm0="}],"size":12462,"noattachment":false,"key":"/ethereumjs-blockchain/-/ethereumjs-blockchain-0.0.0.tgz"},"maintainers":[{"name":"null_radix","email":"mjbecze@gmail.com"}],"directories":{},"deprecated":"New package name format for new versions: @ethereumjs/blockchain. Please update.","readme":"# SYNOPSIS\n\n[![NPM Package](https://img.shields.io/npm/v/ethereumjs-blockchain.svg?style=flat-square)](https://www.npmjs.org/package/ethereumjs-blockchain)\n[![Actions Status](https://github.com/ethereumjs/ethereumjs-blockchain/workflows/blockchain-test/badge.svg)](https://github.com/ethereumjs/ethereumjs-blockchain/actions)\n[![Coverage Status](https://img.shields.io/coveralls/ethereumjs/ethereumjs-blockchain.svg?style=flat-square)](https://coveralls.io/r/ethereumjs/ethereumjs-blockchain)\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereum/ethereumjs-lib?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) or #ethereumjs on freenode\n\nA module to store and interact with blocks.\n\n# INSTALL\n\n`npm install ethereumjs-blockchain`\n\n# API\n\n[./docs/](./docs/README.md)\n\n# EXAMPLE\n\nThe following is an example to iterate through an existing Geth DB (needs `level` to be installed separately).\n\nThis module performs write operations. Making a backup of your data before trying it is recommended. Otherwise, you can end up with a compromised DB state.\n\n```javascript\nconst level = require('level')\nconst Blockchain = require('ethereumjs-blockchain').default\nconst utils = require('ethereumjs-util')\n\nconst gethDbPath = './chaindata' // Add your own path here. It will get modified, see remarks.\nconst db = level(gethDbPath)\n\nnew Blockchain({ db: db }).iterator(\n  'i',\n  (block, reorg, cb) => {\n    const blockNumber = utils.bufferToInt(block.header.number)\n    const blockHash = block.hash().toString('hex')\n    console.log(`BLOCK ${blockNumber}: ${blockHash}`)\n    cb()\n  },\n  err => console.log(err || 'Done.'),\n)\n```\n\n**WARNING**: Since `ethereumjs-blockchain` is also doing write operations\non the DB for safety reasons only run this on a copy of your database, otherwise this might lead\nto a compromised DB state.\n\n# EthereumJS\n\nSee our organizational [documentation](https://ethereumjs.readthedocs.io) for an introduction to `EthereumJS` as well as information on current standards and best practices.\n\nIf you want to join for work or do improvements on the libraries have a look at our [contribution guidelines](https://ethereumjs.readthedocs.io/en/latest/contributing.html).\n","publish_time":1439315235917,"_cnpm_publish_time":1439315235917,"dist-tags":{"latest":"4.0.4"}}