ChainDataStore
Static Method Summary
Static Public Methods | ||
public static |
|
|
public static |
getPersistent(jdb: JungleDB): ChainDataStore |
|
public static |
initPersistent(jdb: JungleDB) |
Constructor Summary
Public Constructor | ||
public |
constructor(chainStore: IObjectStore, blockStore: IObjectStore) |
Member Summary
Public Members | ||
public get |
txs: Array<JDB.Transaction> |
Method Summary
Public Methods | ||
public |
abort(): Promise |
|
public |
commit(): Promise |
|
public |
|
|
public |
async getBlockAt(height: number, includeBody: boolean): PromiseBlock> |
|
public |
|
|
public |
async getBlocksBackward(startBlockHash: Hash, count: number, includeBody: boolean): Promise<Array<Block>> |
|
public |
async getBlocksForward(startBlockHash: Hash, count: number): Promise<Array<Block>> |
|
public |
async getChainData(key: Hash, includeBody: boolean): PromiseChainData> |
|
public |
async getChainDataAt(height: number, includeBody: boolean): PromiseChainData> |
|
public |
async getChainDataCandidatesAt(height: number): Promise<?Array<ChainData>> |
|
public |
|
|
public |
async getNearestBlockAt(height: number, lower: boolean): PromiseBlock> |
|
public |
async getRawBlock(key: Hash, includeForks: boolean): PromiseUint8Array> |
|
public |
async getSuccessorBlocks(block: Block): Promise<Array<Block>> |
|
public |
putChainData(key: Hash, chainData: ChainData, includeBody: boolean): Promise<void> |
|
public |
putChainDataSync(key: Hash, chainData: ChainData, includeBody: boolean): void |
|
public |
removeChainDataSync(key: Hash): void |
|
public |
|
|
public |
setHeadSync(key: Hash): void |
|
public |
|
|
public |
synchronousTransaction(enableWatchdog: boolean): ChainDataStore |
|
public |
transaction(enableWatchdog: boolean): ChainDataStore |
|
public |
truncate(): Promise |
Static Public Methods
public static getPersistent(jdb: JungleDB): ChainDataStore source
Params:
Name | Type | Attribute | Description |
jdb | JungleDB |
public static initPersistent(jdb: JungleDB) source
Params:
Name | Type | Attribute | Description |
jdb | JungleDB |
Public Constructors
public constructor(chainStore: IObjectStore, blockStore: IObjectStore) source
Params:
Name | Type | Attribute | Description |
chainStore | IObjectStore | ||
blockStore | IObjectStore |
Public Members
public get txs: Array<JDB.Transaction> source
Public Methods
public async getBlock(key: Hash, includeBody: boolean): Block source
Params:
Name | Type | Attribute | Description |
key | Hash | ||
includeBody | boolean |
|
public async getBlockAt(height: number, includeBody: boolean): PromiseBlock> source
Params:
Name | Type | Attribute | Description |
height | number | ||
includeBody | boolean |
|
public getBlocks(startBlockHash: Hash, count: number, forward: boolean): Promise<Array<Block>> source
Params:
Name | Type | Attribute | Description |
startBlockHash | Hash | ||
count | number |
|
|
forward | boolean |
|
public async getBlocksBackward(startBlockHash: Hash, count: number, includeBody: boolean): Promise<Array<Block>> source
Params:
Name | Type | Attribute | Description |
startBlockHash | Hash | ||
count | number | ||
includeBody | boolean |
public async getBlocksForward(startBlockHash: Hash, count: number): Promise<Array<Block>> source
Params:
Name | Type | Attribute | Description |
startBlockHash | Hash | ||
count | number |
public async getChainData(key: Hash, includeBody: boolean): PromiseChainData> source
Params:
Name | Type | Attribute | Description |
key | Hash | ||
includeBody | boolean |
|
public async getChainDataAt(height: number, includeBody: boolean): PromiseChainData> source
Params:
Name | Type | Attribute | Description |
height | number | ||
includeBody | boolean |
|
public async getChainDataCandidatesAt(height: number): Promise<?Array<ChainData>> source
Params:
Name | Type | Attribute | Description |
height | number |
public async getNearestBlockAt(height: number, lower: boolean): PromiseBlock> source
Params:
Name | Type | Attribute | Description |
height | number | ||
lower | boolean |
|
public async getRawBlock(key: Hash, includeForks: boolean): PromiseUint8Array> source
Params:
Name | Type | Attribute | Description |
key | Hash | ||
includeForks | boolean |
|
Return:
PromiseUint8Array> |
public async getSuccessorBlocks(block: Block): Promise<Array<Block>> source
Params:
Name | Type | Attribute | Description |
block | Block |
public putChainData(key: Hash, chainData: ChainData, includeBody: boolean): Promise<void> source
Return:
Promise<void> |
public putChainDataSync(key: Hash, chainData: ChainData, includeBody: boolean): void source
Return:
void |
public removeChainDataSync(key: Hash): void source
Params:
Name | Type | Attribute | Description |
key | Hash |
Return:
void |
public setHead(key: Hash): Promise<void> source
Params:
Name | Type | Attribute | Description |
key | Hash |
Return:
Promise<void> |
public setHeadSync(key: Hash): void source
Params:
Name | Type | Attribute | Description |
key | Hash |
Return:
void |
public synchronousTransaction(enableWatchdog: boolean): ChainDataStore source
Params:
Name | Type | Attribute | Description |
enableWatchdog | boolean |
|
public transaction(enableWatchdog: boolean): ChainDataStore source
Params:
Name | Type | Attribute | Description |
enableWatchdog | boolean |
|