Constructors
constructor
- new DataAccess(__namedParameters: DAConstructor): DataAccess
-
Parameters
-
__namedParameters: DAConstructor
Properties
Private
Readonly
_blocksCache
_blocksCache: BlockCache
Private
Readonly
_storage
_storage: Storage
Methods
clearTempBlocks
- clearTempBlocks(): Promise<void>
-
Returns Promise<void>
deleteBlock
- deleteBlock(block: Block, state: CurrentState, saveToTemp?: boolean): Promise<void>
-
Parameters
-
-
-
saveToTemp: boolean = false
Returns Promise<void>
getBlockByHeight
- getBlockByHeight(height: number): Promise<Block>
-
Returns Promise<Block>
getBlockByID
- getBlockByID(id: Buffer): Promise<Block>
-
Returns Promise<Block>
getBlockHeadersByHeightBetween
-
Parameters
-
fromHeight: number
-
toHeight: number
getBlockHeadersByIDs
-
Parameters
-
arrayOfBlockIds: readonly Buffer[]
getBlockHeadersWithHeights
-
Parameters
-
heightList: readonly number[]
getBlocksByHeightBetween
- getBlocksByHeightBetween(fromHeight: number, toHeight: number): Promise<Block[]>
-
Parameters
-
fromHeight: number
-
toHeight: number
Returns Promise<Block[]>
getBlocksByIDs
- getBlocksByIDs(arrayOfBlockIds: readonly Buffer[]): Promise<Block[]>
-
Parameters
-
arrayOfBlockIds: readonly Buffer[]
Returns Promise<Block[]>
getEvents
- getEvents(height: number): Promise<Event[]>
-
Returns Promise<Event[]>
getFinalizedHeight
- getFinalizedHeight(): Promise<number>
-
Returns Promise<number>
getHighestCommonBlockID
- getHighestCommonBlockID(arrayOfBlockIds: readonly Buffer[]): Promise<undefined | Buffer>
-
Parameters
-
arrayOfBlockIds: readonly Buffer[]
Returns Promise<undefined | Buffer>
getInclusionProofs
- getInclusionProofs(height: number): Promise<Proof>
-
Returns Promise<Proof>
getLastBlock
- getLastBlock(): Promise<Block>
-
Returns Promise<Block>
getTempBlocks
- getTempBlocks(): Promise<Block[]>
-
Returns Promise<Block[]>
getTransactionsByIDs
- getTransactionsByIDs(arrayOfTransactionIds: readonly Buffer[]): Promise<Transaction[]>
-
Parameters
-
arrayOfTransactionIds: readonly Buffer[]
isBlockPersisted
- isBlockPersisted(blockId: Buffer): Promise<boolean>
-
Returns Promise<boolean>
isTempBlockEmpty
- isTempBlockEmpty(): Promise<boolean>
-
Returns Promise<boolean>
isTransactionPersisted
- isTransactionPersisted(transactionId: Buffer): Promise<boolean>
-
Returns Promise<boolean>
saveBlock
- saveBlock(block: Block, events: Event[], state: CurrentState, finalizedHeight: number, removeFromTemp?: boolean): Promise<void>
-
Parameters
-
-
-
-
finalizedHeight: number
-
removeFromTemp: boolean = false
Returns Promise<void>
setInclusionProofs
- setInclusionProofs(proof: Proof, height: number): Promise<void>
-
Parameters
-
proof: Proof
-
height: number
Returns Promise<void>
Begin: BlockHeaders