Class BlockStorage
Defines storage for Blocks using memory map file The file is divided into multiple parts.
Constructors
Name | Description |
---|---|
this
(path, logger)
|
Construct an instance of a BlockStorage
|
Fields
Name | Type | Description |
---|---|---|
log
|
Logger | Logger instance |
Methods
Name | Description |
---|---|
load
(genesis)
|
Load the blockchain from the storage |
readBlock
(height)
|
Implementes IBlockStorage
|
readBlock
(hash)
|
Implements IBlockStorage
|
readLastBlock
()
|
Implement IBlockStorage
|
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
|