{"name":"ethereumjs-blockchain","version":"1.4.2","description":"A module to store and interact with blocks","main":"index.js","scripts":{"coverage":"istanbul cover ./test/index.js","coveralls":"npm run coverage && coveralls <coverage/lcov.info","lint":"standard","test":"tape ./test/index.js"},"repository":{"type":"git","url":"git+https://github.com/ethereumjs/ethereumjs-blockchain.git"},"keywords":["ethereum","blockchain"],"author":{"name":"mjbecze","email":"mjbecze@gmail.com"},"license":"MPL-2.0","bugs":{"url":"https://github.com/ethereumjs/ethereumjs-blockchain/issues"},"homepage":"https://github.com/ethereumjs/ethereumjs-blockchain#readme","dependencies":{"async":"^2.1.2","ethashjs":"^0.0.7","ethereumjs-block":"^1.2.2","ethereumjs-util":"^5.0.1","flow-stoplight":"^1.0.0","levelup":"^1.3.0","memdown":"^1.1.0","semaphore":"^1.0.3"},"devDependencies":{"coveralls":"^2.11.4","istanbul":"^0.4.2","standard":"^8.5.0","tape":"^4.2.1"},"gitHead":"d57add8eecb6c22b6fc2e879f3c6d535925a68b7","_id":"ethereumjs-blockchain@1.4.2","_shasum":"e4d17e6523e19b86eb815547b1d21ec2a8a91373","_from":".","_npmVersion":"3.10.9","_nodeVersion":"8.0.0-pre","_npmUser":{"name":"null_radix","email":"null_radix@riseup.net"},"dist":{"shasum":"e4d17e6523e19b86eb815547b1d21ec2a8a91373","tarball":"http://registry-npm.ywwl.com/ethereumjs-blockchain/download/ethereumjs-blockchain-1.4.2.tgz","integrity":"sha512-fU0FM+kPw6XlF3gevyeD32UIUyBV3WfPs4usq0d0PvDyWyLILPskxWklLDq6vQJAf4W3LRIAsqnkoX8E2xzfUw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1YLJmzAGOWk60vpkGWy5OPjKjDkpbH2LAx3TB5GkZpgIhANNghaUGvSNFt6QKZR292r210Qm/YwYCUuEXJladIkSI"}],"size":38266,"noattachment":false,"key":"/ethereumjs-blockchain/-/ethereumjs-blockchain-1.4.2.tgz"},"maintainers":[{"name":"kumavis","email":"aaron@kumavis.me"},{"name":"null_radix","email":"null_radix@riseup.net"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/ethereumjs-blockchain-1.4.2.tgz_1482969325329_0.5673344491515309"},"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":1482969325888,"_cnpm_publish_time":1482969325888,"dist-tags":{"latest":"4.0.4"}}