Class: FileBatch

blockstore.FileBatch()

Batch operations for fileblockstore. Currently, this is not meant for atomicity or performance improvements, but to have better interface for chaindb. Proper implementation could use single batch for leveldb updates after all file writes.

Constructor

new FileBatch()

Create AbstractBatch.

Source:

Methods

clear() → {Batch}

Clear the batch.

Source:
Returns:
Type
Batch

(async) commit() → {Promise}

Commit both.

Source:
Returns:
Type
Promise

(async) commitPrunes() → {Promise}

Commit only prunes.

Source:
Returns:
Type
Promise

(async) commitWrites() → {Promise}

Commit only writes.

Source:
Returns:
Type
Promise

pruneBlock(hash) → {Batch}

Prune block data from the batch.

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

pruneMerkle(hash) → {Batch}

Remove merkle block data from the batch.

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

pruneUndo(hash) → {Batch}

Remove undo data from the batch.

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

writeBlock(hash, data) → {Batch}

Write block data to the batch.

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

writeMerkle() → {Batch}

Write merkle block data to the batch.

Properties:
Name Type Description
hash Buffer
data Buffer
Source:
Returns:
Type
Batch

writeUndo(hash, data) → {Batch}

Write undo coin data to the batch.

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