/merkle-trie

Primary LanguageJavaScript

SYNOPSIS

NPM Package Build Status Coverage Status

js-standard-style

A merkle trie implemention that if focused on being generic and fast

INSTALL

npm install merkle-trie

USAGE

  const Vertex = require('merkle-trie')
  const Store = require('merkle-trie/store.js')
  let newVertex = new Vertex({store: store})
  const path = ['not', 'all', 'those', 'who', 'wanderer', 'are', 'lost']
  const value = 'all that is gold does not glitter'

  newVertex.set(path, new Vertex({value: value}))
  newVertex.get(path)
  .then(vertex => {
    // retrieves the vertex that was stored
    newVertex.del(path)
  })
  .flush(link => {
    // saves all the work done on the trie to the store
    // and return the merkle link to the root vertex
  })

TESTS

npm run tests

API

./docs/

LICENSE

MPL-2.0