Class: AbstractBlockStore

(abstract) blockstore.AbstractBlockStore()

Abstract Block Store

Constructor

(abstract) new AbstractBlockStore()

Create an abstract blockstore.

Source:

Methods

batch() → {Batch}

Create batch.

Source:
Returns:
Type
Batch

(async) close() → {Promise}

This method closes resources and prepares the store to be closed.

Source:
Returns:
Type
Promise

(async) ensure() → {Promise}

This method ensures that resources are available before opening.

Source:
Returns:
Type
Promise

(async) hasBlock(hash) → {Promise}

This will check if a block has been stored and is available.

Parameters:
Name Type Description
hash Buffer
Source:
Returns:
Type
Promise

(async) hasMerkle(hash) → {Promise}

This will check if merkle block data has been stored and is available.

Parameters:
Name Type Description
hash Buffer
Source:
Returns:
Type
Promise

(async) hasUndo(hash) → {Promise}

This will check if a block undo coin data has been stored and is available.

Parameters:
Name Type Description
hash Buffer
Source:
Returns:
Type
Promise

(async) open() → {Promise}

This method opens any necessary resources and initializes the store to be ready to be queried.

Source:
Returns:
Type
Promise

(async) pruneBlock(hash) → {Promise}

This will free resources for storing the block data.

Parameters:
Name Type Description
hash Buffer
Source:
Returns:
Type
Promise

(async) pruneMerkle(hash) → {Promise}

This will free resources for storing the merkle block data.

Parameters:
Name Type Description
hash Buffer
Source:
Returns:
Type
Promise

(async) pruneUndo(hash) → {Promise}

This will free resources for storing the block undo coin data.

Parameters:
Name Type Description
hash Buffer
Source:
Returns:
Type
Promise

(async) readBlock(hash, offset, size) → {Promise}

This method will retrieve block data. Smaller portions of the block can be read by using the offset and size arguments.

Parameters:
Name Type Description
hash Buffer
offset Number
size Number
Source:
Returns:
Type
Promise

(async) readMerkle(hash) → {Promise}

This method reads merkle block data.

Parameters:
Name Type Description
hash Buffer
Source:
Returns:
Type
Promise

(async) readUndo(hash) → {Promise}

This method will retrieve block undo coin data.

Parameters:
Name Type Description
hash Buffer
Source:
Returns:
Type
Promise

(async) writeBlock(hash, data) → {Promise}

This method stores block data.

Parameters:
Name Type Description
hash Buffer
data Buffer
Source:
Returns:
Type
Promise

(async) writeMerkle(hash, data) → {Promise}

This method stores merkle blocks including all the relevant transactions.

Parameters:
Name Type Description
hash Buffer
data Buffer
Source:
Returns:
Type
Promise

(async) writeUndo(hash, data) → {Promise}

This method stores block undo coin data.

Parameters:
Name Type Description
hash Buffer
data Buffer
Source:
Returns:
Type
Promise