Home Reference Source Test
public class | source

NanoConsensus

Extends:

ObservableBaseConsensus → NanoConsensus

Constructor Summary

Public Constructor
public

constructor(blockchain: NanoChain, mempool: NanoMempool, network: Network)

Member Summary

Public Members
public get
public get

Method Summary

Public Methods
public

addSubscriptions(newAddresses: Array<Address> | Address)

public

async getAccount(address: Address, blockHash: Hash): PromiseAccount>

public

async getAccounts(addresses: Array<Address>, blockHash: Hash): Promise<Array<Account>>

public

async relayTransaction(transaction: Transaction): Promise<void>

public

removeSubscriptions(addressesToRemove: Array<Address> | Address)

public

subscribeAccounts(addresses: Array<Address>)

Protected Methods
protected

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

established: boolean

public get
public get
public

subscribe(subscription: Subscription)

protected
protected
protected
protected

_onPeerLeft(peer: Peer)

protected
protected
protected
protected
protected

async _requestBlockProof(blockHashToProve: Hash, blockHeightToProve: number): Promise<Block>

protected

async _requestTransactionHistory(address: Address): Promise<Array<{transaction: Transaction, header: BlockHeader}>>

protected

async _requestTransactionReceipts(address: Address): Promise<Array<TransactionReceipt>>

protected

async _requestTransactionsProof(addresses: Array<Address>, block: Block): Promise<Array<Transaction>>

protected

Public Constructors

public constructor(blockchain: NanoChain, mempool: NanoMempool, network: Network) source

Override:

BaseConsensus#constructor

Params:

NameTypeAttributeDescription
blockchain NanoChain
mempool NanoMempool
network Network

Public Members

public get blockchain: NanoChain source

public get mempool: NanoMempool source

Public Methods

public addSubscriptions(newAddresses: Array<Address> | Address) source

Params:

NameTypeAttributeDescription
newAddresses Array<Address> | Address

public async getAccount(address: Address, blockHash: Hash): PromiseAccount> source

Params:

NameTypeAttributeDescription
address Address
blockHash Hash
  • optional

Return:

PromiseAccount>

public async getAccounts(addresses: Array<Address>, blockHash: Hash): Promise<Array<Account>> source

Params:

NameTypeAttributeDescription
addresses Array<Address>
blockHash Hash
  • optional

Return:

Promise<Array<Account>>

public async relayTransaction(transaction: Transaction): Promise<void> source

Params:

NameTypeAttributeDescription
transaction Transaction

Return:

Promise<void>

public removeSubscriptions(addressesToRemove: Array<Address> | Address) source

Params:

NameTypeAttributeDescription
addressesToRemove Array<Address> | Address

public subscribeAccounts(addresses: Array<Address>) source

Params:

NameTypeAttributeDescription
addresses Array<Address>

Protected Methods

protected _onTransactionAdded(tx: Transaction) source

Override:

BaseConsensus#_onTransactionAdded

Params:

NameTypeAttributeDescription
tx Transaction