Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ethereumjs-blockchain
Advanced tools
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
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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.