Skip to content
This repository was archived by the owner on Apr 6, 2020. It is now read-only.

New release v4.0.0 #106

Merged
merged 1 commit into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,40 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
(modification: no type change headlines) and this project adheres to
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [4.0.0] - 2019-04-26

First **TypeScript** based release of the library. `TypeScript` handles `ES6` transpilation
[a bit differently](https://github.com/Microsoft/TypeScript/issues/2719) (at the
end: cleaner) than `babel` so `require` syntax of the library slightly changes to:

```javascript
let Blockchain = require('ethereumjs-blockchain').default
```

The library now also comes with a **type declaration file** distributed along
with the package published.

This release drops support for Node versions `4` and `6` due to
internal code updates requiring newer Node.js versions and removes the previously
deprecated DB constructor options `opts.blockDb` and `opts.detailsDb`.

**Change Summary:**

- Migration of code base and internal toolchain to `TypeScript`,
PR [#92](https://github.com/ethereumjs/ethereumjs-blockchain/pull/92)
- Refactoring of `DB` operations introducing a separate `DBManager` class
(comes along with dropped Node `6` support),
PR [#91](https://github.com/ethereumjs/ethereumjs-blockchain/pull/91)
- Auto-generated `TSDoc` documentation,
PR [#98](https://github.com/ethereumjs/ethereumjs-blockchain/pull/98)
- Replaced `safe-buffer` with native Node.js `Buffer` usage (this comes along
with dropped support for Node `4`),
PR [#92](https://github.com/ethereumjs/ethereumjs-blockchain/pull/92)
- Dropped deprecated `DB` options,
PR [#100](https://github.com/ethereumjs/ethereumjs-blockchain/pull/100)

[4.0.0]: https://github.com/ethereumjs/ethereumjs-blockchain/compare/v3.4.0...v4.0.0

## [3.4.0] - 2019-02-06

**Petersburg** (aka `constantinopleFix`) as well as **Goerli**
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ A module to store and interact with blocks.

[./docs/](./docs/README.md)

# EXAMPLE USAGE
# EXAMPLE

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.

```javascript
const level = require('level')
const Blockchain = require('ethereumjs-blockchain')
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.
Expand All @@ -40,3 +40,7 @@ new Blockchain({ db: db }).iterator(
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.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereumjs-blockchain",
"version": "3.4.0",
"version": "4.0.0",
"description": "A module to store and interact with blocks",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down