ethereumjs-monorepo

@ethereumjs/binarytree


@ethereumjs/binarytree / BinaryTreeOpts

Interface: BinaryTreeOpts

Defined in: types.ts:6

Options for createBinaryTree and BinaryTree.

Properties

cacheSize

cacheSize: number

Defined in: types.ts:27

LRU cache for tree nodes to allow for faster node retrieval.

Default: 0 (deactivated)


db

db: DB<string, string | Uint8Array<ArrayBufferLike>>

Defined in: types.ts:10

A database instance.


hashFunction

hashFunction: (msg) => Uint8Array

Defined in: types.ts:32

Hash function used for hashing the tree nodes.

Parameters

msg

Uint8Array

Returns

Uint8Array


root?

optional root?: Uint8Array<ArrayBufferLike>

Defined in: types.ts:15

A Uint8Array for the root of a previously stored tree


useRootPersistence

useRootPersistence: boolean

Defined in: types.ts:20

Store the root inside the database after every write operation