Permalink
Browse files

Merge pull request #48 from ethereumjs/readstream-example

Added Geth read stream example to the README
  • Loading branch information...
holgerd77 committed Jun 26, 2018
2 parents 75dff20 + b973451 commit bc42cdebb3bcaa3260e072e5c02fe130531f3222
Showing with 20 additions and 0 deletions.
  1. +20 −0 README.md
View
@@ -46,6 +46,26 @@ Trie.prove(trie, 'test', function (err, prove) {
})
```
## Read stream on Geth DB
```javascript
var levelup = require('levelup')
var Trie = require('./secure')
var stateRoot = "0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544" // Block #222
var db = levelup('YOUR_PATH_TO_THE_GETH_CHAIN_DB')
var trie = new Trie(db, stateRoot)
trie.createReadStream()
.on('data', function (data) {
console.log(data)
})
.on('end', function() {
console.log('End.')
})
```
# API
[./docs/](./docs/index.md)

0 comments on commit bc42cde

Please sign in to comment.