Home Reference Source Test
public class | source

PartialLightChain

Extends:

ObservableIBlockchainBaseChainFullChainLightChain → PartialLightChain

Constructor Summary

Public Constructor
public

constructor(store: ChainDataStore, accounts: Accounts, time: Time, proof: ChainProof, commitSynchronizer: PrioritySynchronizer): PartialLightChain

Member Summary

Public Members
public get

proofHeadHeight: number

public get

state: PartialLightChain.State

Method Summary

Public Methods
public

async abort(): Promise<void>

public

async commit(): Promise<boolean>

public
public
public

needsMoreBlocks(): boolean

public

numBlocksNeeded(): number

public

async pushAccountsTreeChunk(chunk: AccountsTreeChunk): Promise<PartialAccountsTree.Status>

public

pushProof(proof: ChainProof): Promise<boolean>

Protected Methods
protected

async _acceptProof(proof: ChainProof, suffix: Array<Block>): Promise<void>

Inherited Summary

From class Observable
public static get

WILDCARD: string: string

public

bubble(observable: Observable, types: ...string)

public

fire(type: string, args: ...*): Promise | null

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

async getBlock(hash: Hash, includeForks: boolean, includeBody: boolean): PromiseBlock>

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

MUST be synchronized with .pushBlock() and variants!

From class FullChain
public static

createVolatile(accounts: Accounts, time: Time, transactionStore: TransactionStore): Promise<FullChain>

public static

getPersistent(jdb: JungleDB, accounts: Accounts, time: Time, transactionStore: TransactionStore): Promise<FullChain>

public get
public get
public get
public get
public get

blockKnownCount: number

public get
public get
public get
public get
public get

height: *

public get
public get
public get
public get
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

getBlocks(startBlockHash: Hash, count: number, forward: boolean): Promise<Array<Block>>

public
public

async getTransactionInfoByHash(transactionHash: Hash): PromiseTransactionStoreEntry>

public

async getTransactionReceiptsByAddress(address: Address, limit: number): Promise<Array<TransactionReceipt>>

public

async getTransactionsProof(blockHash: Hash, addresses: Array<Address>): PromiseTransactionsProof>

public

pushBlock(block: Block): Promise<number>

protected

async _init(): Promise<FullChain>

protected

async _pushBlock(block: Block): Promise<number>

protected

async _rebranch(blockHash: Hash, chainData: ChainData): Promise<boolean>

protected

async _verifyInterlink(block: Block): Promise<boolean>

From class LightChain
public static

createVolatile(accounts: Accounts, time: Time): Promise<LightChain>

public static

getPersistent(jdb: JungleDB, accounts: Accounts, time: Time): Promise<LightChain>

public
protected

async _init(): *

Public Constructors

public constructor(store: ChainDataStore, accounts: Accounts, time: Time, proof: ChainProof, commitSynchronizer: PrioritySynchronizer): PartialLightChain source

Override:

LightChain#constructor

Params:

NameTypeAttributeDescription
store ChainDataStore
accounts Accounts
time Time
proof ChainProof
commitSynchronizer PrioritySynchronizer

Public Members

public get proofHeadHeight: number source

public get state: PartialLightChain.State source

Public Methods

public async abort(): Promise<void> source

Return:

Promise<void>

public async commit(): Promise<boolean> source

Return:

Promise<boolean>

public getBlockLocators(): Array<Hash> source

Override:

BaseChain#getBlockLocators

Return:

Array<Hash>

public getMissingAccountsPrefix(): string source

Return:

string

public needsMoreBlocks(): boolean source

Return:

boolean

public numBlocksNeeded(): number source

Return:

number

public async pushAccountsTreeChunk(chunk: AccountsTreeChunk): Promise<PartialAccountsTree.Status> source

Params:

NameTypeAttributeDescription
chunk AccountsTreeChunk

Return:

Promise<PartialAccountsTree.Status>

public pushProof(proof: ChainProof): Promise<boolean> source

Params:

NameTypeAttributeDescription
proof ChainProof

Return:

Promise<boolean>

Protected Methods

protected async _acceptProof(proof: ChainProof, suffix: Array<Block>): Promise<void> source

Params:

NameTypeAttributeDescription
proof ChainProof
suffix Array<Block>

Return:

Promise<void>