
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
ethereumjs-blockchain
Advanced tools
Supply Chain Security
Vulnerability
Quality
Maintenance
License
A module to store and interact with blocks.
npm install ethereumjs-blockchain
The following is an example to iterate through an existing Geth DB (needs level
to be installed separately).
This 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.
const level = require('level')
const Blockchain = require('ethereumjs-blockchain').default
const utils = require('ethereumjs-util')
const gethDbPath = './chaindata' // Add your own path here. It will get modified, see remarks.
const db = level(gethDbPath)
new Blockchain({ db: db }).iterator(
'i',
(block, reorg, cb) => {
const blockNumber = utils.bufferToInt(block.header.number)
const blockHash = block.hash().toString('hex')
console.log(`BLOCK ${blockNumber}: ${blockHash}`)
cb()
},
err => console.log(err || 'Done.'),
)
WARNING: Since ethereumjs-blockchain
is also doing write operations
on the DB for safety reasons only run this on a copy of your database, otherwise this might lead
to a compromised DB state.
See our organizational documentation for an introduction to EthereumJS
as well as information on current standards and best practices.
If you want to join for work or do improvements on the libraries have a look at our contribution guidelines.
FAQs
A module to store and interact with blocks
The npm package ethereumjs-blockchain receives a total of 153,949 weekly downloads. As such, ethereumjs-blockchain popularity was classified as popular.
We found that ethereumjs-blockchain demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.