FullConsensus
Extends:
Constructor Summary
Public Constructor | ||
public |
constructor(blockchain: FullChain, mempool: Mempool, network: Network) |
Member Summary
Public Members | ||
public get |
|
|
public get |
|
|
public get |
minFeePerByte: number |
Method Summary
Public Methods | ||
public |
getAccounts(addresses: Array<Address>): Promise<Array<Account>> |
|
public |
getBlock(hash: Hash, includeBody: boolean, includeBodyFromLocal: boolean, blockHeight: number): Promise<Block> |
|
public |
getBlockAt(height: number, includeBody: boolean): Promise<Block> |
|
public |
getBlockTemplate(minerAddress: Address, extraData: Uint8Array): Promise<Block> |
|
public |
getMempoolContents(): Array<Transaction> |
|
public |
async getPendingTransactions(hashes: Array<Hash>): Promise<Array<Transaction>> |
|
public |
async getPendingTransactionsByAddress(address: Address): Promise<Array<Transaction>> |
|
public |
getTransactionReceiptsByAddress(address: Address): Promise<Array<TransactionReceipt>> |
|
public |
getTransactionReceiptsByHashes(hashes: Array<Hash>): Promise<Array<TransactionReceipt>> |
|
public |
async getTransactionsFromBlock(hashes: Array<Hash>, blockHash: Hash, blockHeight: number, block: Block): Promise<Array<Transaction>> |
|
public |
async sendTransaction(tx: Transaction): Promise<BaseConsensus.SendTransactionResult> |
|
public |
async submitBlock(block: Block): Promise<boolean> |
|
public |
subscribeMinFeePerByte(minFeePerByte: number) |
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 BaseConsensus | ||
public get |
established: boolean |
|
public get |
|
|
public get |
|
|
protected |
_established: boolean |
|
public abstract |
async getAccounts(addresses: Array<Address>): Promise<Array<Account>> |
|
public |
async getBlock(hash: Hash, includeBody: boolean, includeBodyFromLocal: boolean, blockHeight: number): Promise<Block> |
|
public |
async getBlockAt(height: number, includeBody: boolean): Promise<Block> |
|
public |
async getBlockTemplate(minerAddress: Address, extraData: Uint8Array): Promise<Block> |
|
public |
async getHeadHash(): Promise<Hash> |
|
public |
async getHeadHeight(): Promise<number> |
|
public |
getMempoolContents(): Array<Transaction> |
|
public |
getPendingTransactions(hashes: Array<Hash>): Promise<Array<Transaction>> |
|
public |
async getPendingTransactionsByAddress(address: Address): Promise<Array<Transaction>> |
|
public |
|
|
public |
getTransactionReceiptsByAddress(address: Address): Promise<Array<TransactionReceipt>> |
|
public |
getTransactionReceiptsByHashes(hashes: Array<Hash>): Promise<Array<TransactionReceipt>> |
|
public |
async getTransactionsFromBlock(hashes: Array<Hash>, blockHash: Hash, blockHeight: number, block: Block): Promise<Array<Transaction>> |
|
public |
async getTransactionsFromBlockByAddresses(addresses: Array<Address>, blockHash: Hash, blockHeight: number): Promise<Array<Transaction>> |
|
public |
handoverTo(consensus: BaseConsensus): BaseConsensus |
|
public abstract |
async sendTransaction(tx: Transaction): Promise<BaseConsensus.SendTransactionResult> |
|
public |
async submitBlock(block: Block): Promise<boolean> |
|
public |
subscribe(subscription: Subscription) |
|
protected |
|
|
protected |
_hasEnoughPeers(numSyncedFullNodes: number, numSyncedNodes: number): boolean |
|
protected |
_newConsensusAgent(peer: Peer): BaseConsensusAgent |
|
protected |
_onHeadChanged(head: Block) |
|
protected |
_onPeerJoined(peer: Peer): BaseConsensusAgent |
|
protected |
_onPeerLeft(peer: Peer) |
|
protected |
_onPeerOutOfSync(peer: Peer) |
|
protected |
_onPeerSynced(peer: Peer) |
|
protected |
_onToDisconnect(obj: Observable, type: string, callback: function) |
|
protected |
|
|
protected |
|
|
protected |
async _requestBlockProof(blockHashToProve: Hash, blockHeightToProve: number): Promise<Block> |
|
protected |
async _requestBlockProofAt(blockHeightToProve: number): Promise<Block> |
|
protected |
async _requestTransactionHistory(address: Address): Promise<Array<{transaction: Transaction, header: BlockHeader}>>{transaction:> this method was deprecated.
|
|
protected |
async _requestTransactionReceiptsByAddress(address: Address): Promise<Array<TransactionReceipt>> |
|
protected |
async _requestTransactionsByAddresses(addresses: Array<Address>, block: Block): Promise<Array<Transaction>> |
|
protected |
|
Public Constructors
Public Members
public get minFeePerByte: number source
Public Methods
public getAccounts(addresses: Array<Address>): Promise<Array<Account>> source
Override:
BaseConsensus#getAccountsParams:
Name | Type | Attribute | Description |
addresses | Array<Address> |
public getBlock(hash: Hash, includeBody: boolean, includeBodyFromLocal: boolean, blockHeight: number): Promise<Block> source
Override:
BaseConsensus#getBlockParams:
Name | Type | Attribute | Description |
hash | Hash | ||
includeBody | boolean |
|
|
includeBodyFromLocal | boolean |
|
|
blockHeight | number |
|
public getBlockAt(height: number, includeBody: boolean): Promise<Block> source
Override:
BaseConsensus#getBlockAtParams:
Name | Type | Attribute | Description |
height | number | ||
includeBody | boolean |
|
public getBlockTemplate(minerAddress: Address, extraData: Uint8Array): Promise<Block> source
Override:
BaseConsensus#getBlockTemplateParams:
Name | Type | Attribute | Description |
minerAddress | Address | ||
extraData | Uint8Array |
|
public async getPendingTransactions(hashes: Array<Hash>): Promise<Array<Transaction>> source
Override:
BaseConsensus#getPendingTransactionsParams:
Name | Type | Attribute | Description |
hashes | Array<Hash> |
public async getPendingTransactionsByAddress(address: Address): Promise<Array<Transaction>> source
Params:
Name | Type | Attribute | Description |
address | Address |
public getTransactionReceiptsByAddress(address: Address): Promise<Array<TransactionReceipt>> source
Params:
Name | Type | Attribute | Description |
address | Address |
public getTransactionReceiptsByHashes(hashes: Array<Hash>): Promise<Array<TransactionReceipt>> source
Params:
Name | Type | Attribute | Description |
hashes | Array<Hash> |
public async getTransactionsFromBlock(hashes: Array<Hash>, blockHash: Hash, blockHeight: number, block: Block): Promise<Array<Transaction>> source
public async sendTransaction(tx: Transaction): Promise<BaseConsensus.SendTransactionResult> source
Override:
BaseConsensus#sendTransactionParams:
Name | Type | Attribute | Description |
tx | Transaction |
Return:
Promise<BaseConsensus.SendTransactionResult> |
public async submitBlock(block: Block): Promise<boolean> source
Override:
BaseConsensus#submitBlockParams:
Name | Type | Attribute | Description |
block | Block |
Return:
Promise<boolean> |
public subscribeMinFeePerByte(minFeePerByte: number) source
Params:
Name | Type | Attribute | Description |
minFeePerByte | number |