FullChain
Extends:
Direct Subclass:
Indirect Subclass:
An anchored, contiguous chain of full blocks.
Static Method Summary
Static Public Methods | ||
public static |
createVolatile(accounts: Accounts, time: Time, transactionStore: TransactionStore): Promise<FullChain> |
|
public static |
getPersistent(jdb: JungleDB, accounts: Accounts, time: Time, transactionStore: TransactionStore): Promise<FullChain> |
Constructor Summary
Public Constructor | ||
public |
constructor(store: ChainDataStore, accounts: Accounts, time: Time, transactionStore: TransactionStore): FullChain |
Member Summary
Public Members | ||
public get |
|
|
public get |
blockExtendedCount: number |
|
public get |
blockForkedCount: number |
|
public get |
blockInvalidCount: number |
|
public get |
blockKnownCount: number |
|
public get |
blockOrphanCount: number |
|
public get |
blockRebranchedCount: number |
|
public get |
|
|
public get |
|
|
public get |
height: * |
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
Method Summary
Public Methods | ||
public |
accountsHash(): Promise<Hash> |
|
public |
async getAccountsProof(blockHash: Hash, addresses: Array<Address>): PromiseAccountsProof> |
|
public |
async getAccountsTreeChunk(blockHash: Hash, startPrefix: string): PromiseAccountsTreeChunk> |
|
public |
getBlockProof(blockToProve: Block, knownBlock: Block): PromiseBlockChain> |
|
public |
|
|
public |
getChainProof(): Promise<ChainProof> |
|
public |
async getTransactionInfoByHash(transactionHash: Hash): PromiseTransactionStoreEntry> |
|
public |
async getTransactionReceiptsByAddress(address: Address, limit: number): Promise<?Array<TransactionReceipt>> |
|
public |
async getTransactionReceiptsByHashes(hashes: Array<Hash>, limit: number): Promise<?Array<TransactionReceipt>> |
|
public |
async getTransactionsProof(blockHash: Hash, addresses: Array<Address>): PromiseTransactionsProof> this method was deprecated.
|
|
public |
async getTransactionsProofByAddresses(blockHash: Hash, addresses: Array<Address>): PromiseTransactionsProof> |
|
public |
async getTransactionsProofByHashes(blockHash: Hash, hashes: Array<Hash>): PromiseTransactionsProof> |
|
public |
|
Protected Methods | ||
protected |
|
|
protected |
async _pushBlock(block: Block): Promise<number> |
|
protected |
|
|
protected |
async _verifyInterlink(block: Block): Promise<boolean> |
Inherited Summary
From class Observable | ||
public static get |
WILDCARD: string: string |
|
public |
bubble(observable: Observable, types: ...string) |
|
public |
fire(type: string, args: ...*): Promise |
|
public |
off(type: string, id: number) |
|
public |
on(type: string, callback: Function): number |
From class IBlockchain | ||
public get abstract |
|
|
public get abstract |
|
|
public get abstract |
height: number |
From class BaseChain | ||
public static |
async isBetterProof(proof1: ChainProof, proof2: ChainProof, m: number): Promise<boolean> |
|
public static |
async manyPow(headers: Array<BlockHeader>): Promise<void> |
|
protected static |
async _getProofScore(chain: BlockChain, lca: Block, m: number): Promise<number> |
|
public |
|
|
public |
getBlockAt(height: number, includeBody: boolean): PromiseBlock> |
|
public |
async getBlockLocators(): Promise<Array<Hash>> |
|
public |
getNearestBlockAt(height: number, lower: boolean): PromiseBlock> |
|
public |
async getNextTarget(block: Block, next: Block): Promise<BigNumber> Computes the target value for the block after the given block or the head of this chain if no block is given. |
|
public |
getRawBlock(hash: Hash, includeForks: boolean): PromiseUint8Array> |
|
public |
async getSuccessorBlocks(block: Block): Promise<Array<Block>> |
|
protected |
async _extendChainProof(proof: ChainProof, header: BlockHeader, failOnBadness: boolean): Promise<ChainProof> |
|
protected |
async _getBlockProof(blockToProve: Block, knownBlock: Block): PromiseBlockChain> MUST be synchronized with .pushBlock() and variants! |
|
protected |
_getChainProof(): Promise<ChainProof> MUST be synchronized with .pushBlock() and variants! |
Static Public Methods
public static createVolatile(accounts: Accounts, time: Time, transactionStore: TransactionStore): Promise<FullChain> source
Params:
Name | Type | Attribute | Description |
accounts | Accounts | ||
time | Time | ||
transactionStore | TransactionStore |
|
public static getPersistent(jdb: JungleDB, accounts: Accounts, time: Time, transactionStore: TransactionStore): Promise<FullChain> source
Params:
Name | Type | Attribute | Description |
jdb | JungleDB | ||
accounts | Accounts | ||
time | Time | ||
transactionStore | TransactionStore |
|
Public Constructors
public constructor(store: ChainDataStore, accounts: Accounts, time: Time, transactionStore: TransactionStore): FullChain source
Override:
BaseChain#constructorParams:
Name | Type | Attribute | Description |
store | ChainDataStore | ||
accounts | Accounts | ||
time | Time | ||
transactionStore | TransactionStore |
|
Public Members
public get blockExtendedCount: number source
public get blockForkedCount: number source
public get blockInvalidCount: number source
public get blockKnownCount: number source
public get blockOrphanCount: number source
public get blockRebranchedCount: number source
public get queue: PrioritySynchronizer source
public get transactionCache: TransactionCache source
Public Methods
public async getAccountsProof(blockHash: Hash, addresses: Array<Address>): PromiseAccountsProof> source
public async getAccountsTreeChunk(blockHash: Hash, startPrefix: string): PromiseAccountsTreeChunk> source
Params:
Name | Type | Attribute | Description |
blockHash | Hash | ||
startPrefix | string |
public getBlockProof(blockToProve: Block, knownBlock: Block): PromiseBlockChain> source
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 getTransactionInfoByHash(transactionHash: Hash): PromiseTransactionStoreEntry> source
Params:
Name | Type | Attribute | Description |
transactionHash | Hash |
public async getTransactionReceiptsByAddress(address: Address, limit: number): Promise<?Array<TransactionReceipt>> source
Params:
Name | Type | Attribute | Description |
address | Address | ||
limit | number |
|
public async getTransactionReceiptsByHashes(hashes: Array<Hash>, limit: number): Promise<?Array<TransactionReceipt>> source
Params:
Name | Type | Attribute | Description |
hashes | Array<Hash> | ||
limit | number |
|
public async getTransactionsProof(blockHash: Hash, addresses: Array<Address>): PromiseTransactionsProof> source
public async getTransactionsProofByAddresses(blockHash: Hash, addresses: Array<Address>): PromiseTransactionsProof> source
public async getTransactionsProofByHashes(blockHash: Hash, hashes: Array<Hash>): PromiseTransactionsProof> source
public pushBlock(block: Block): Promise<number> source
Params:
Name | Type | Attribute | Description |
block | Block |
Return:
Promise<number> |
Protected Methods
protected async _pushBlock(block: Block): Promise<number> source
Params:
Name | Type | Attribute | Description |
block | Block |
Return:
Promise<number> |