Skip to content

Latest commit

 

History

History
183 lines (100 loc) · 4.34 KB

File metadata and controls

183 lines (100 loc) · 4.34 KB

Table of Contents

constructor

index.js:18-25

Parameters

  • opts
    • opts.root {object} a merkle root to a radix tree. If none, RadixTree will create an new root.
    • opts.db {object} a level db instance; alternatively, opts.graph can be used
    • opts.graph {object} an instance of ipld-graph-builder; alternatively, opts.dag can be used
    • opts.dag {object} an instance if ipfs.dag. If there is no opts.graph this will be used to create a new graph instance.
    • opts.decoder {object} a cbor decoder

root

index.js:31-33

the root of the tree

Type: Buffer

get

index.js:44-48

gets a value given a key

Parameters

  • key any

Returns Promise

set

index.js:98-101

stores a value at a given key returning the tree node that the value was saved in

Parameters

  • key any
  • value

Returns Promise

delete

index.js:150-153

smContainer.js deletes a value at a given key

Parameters

  • key any

Returns Promise

done

index.js:212-218

returns a promise that resolve when the tree is done with all of its writes

Returns Promise

flush

index.js:234-238

creates a merkle root for the current tree and stores the data persistently

Returns Promise

rootExists

index.js:250-258

Checks if a given root exists or not

Parameters

Returns Promise<boolean>

emptyTreeState

index.js:279-281

returns the state of an empty tree

ArrayConstructor

index.js:287-289

returns an Uint1Array constructor which is used to represent keys

Returns object

getMerkleLink

index.js:296-298

returns a merkle link for some given data

Parameters

  • data Buffer the data which you would like to hash

Returns Buffer