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

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

(async) write() → {Promise}

Write change to the store.

Source:
Returns:
Type
Promise

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