Class BlockStorage

Defines storage for Blocks using memory map file The file is divided into multiple parts.

class BlockStorage
  : IBlockStorage ;

Constructors

NameDescription
this (path, logger) Construct an instance of a BlockStorage

Fields

NameTypeDescription
log LoggerLogger instance

Methods

NameDescription
load (genesis) Load the blockchain from the storage
readBlock (height) Implementes IBlockStorage.readBlock(in Height)
readBlock (hash) Implements IBlockStorage.readBlock(in Hash)
readLastBlock () Implement IBlockStorage.readLastBlock
release () Release memory mapped file.
removeIndexFile (path) Remove the index file.
saveBlock (block) Save block to the file.
updateBlockSig (height, hash, sig, validators) Implements IBlockStorage.updateBlockSig