Home Reference Source
public class | source

InterfaceBlockchainMining

Extends:

InterfaceBlockchainMiningBasic → InterfaceBlockchainMining

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public

block: *

public
public
public
Private Members
private

Method Summary

Public Methods
public

calculateHash(nonce: *): *

public

async getNextBlock(): *

public

async mine(block: *, difficulty: *): Promise<boolean>

Simple Mining with no Workers

public

async mineBlock(block: *, difficulty: *)

Mine a specific Block

public

async mineNextBlock(suspend: *)

mine next block

Private Methods
private

async _mineNonces(start: *, end: *): {"result": *, "hash": *, "nonce": *}

private

Inherited Summary

From class InterfaceBlockchainMiningBasic
public get
public set
public get
public set
public get
public
public
public
public
public
public
private
private
private
private
private
private
private
public

async loadMinerAddress(defaultAddress: *, Wallet: *): boolean

public

async mineNextBlock(suspend: *)

public
public

async saveMinerAddress(minerAddress: *): boolean

public

async startMining()

public
private
private

_setAddress(newAddress: *, save: boolean): *

private

Public Constructors

public constructor() source

Override:

InterfaceBlockchainMiningBasic#constructor

Public Members

public bestHash: * source

public bestHashNonce: * source

public block: * source

public difficulty: * source

public miningTransactionSelector: * source

Private Members

Public Methods

public calculateHash(nonce: *): * source

Params:

NameTypeAttributeDescription
nonce *

Return:

*

public async getNextBlock(): * source

Return:

*

public async mine(block: *, difficulty: *): Promise<boolean> source

Simple Mining with no Workers

Params:

NameTypeAttributeDescription
block *
difficulty *

Return:

Promise<boolean>

public async mineBlock(block: *, difficulty: *) source

Mine a specific Block

Params:

NameTypeAttributeDescription
block *
difficulty *

public async mineNextBlock(suspend: *) source

mine next block

Override:

InterfaceBlockchainMiningBasic#mineNextBlock

Params:

NameTypeAttributeDescription
suspend *

Private Methods

private async _mineNonces(start: *, end: *): {"result": *, "hash": *, "nonce": *} source

Params:

NameTypeAttributeDescription
start *
end *

Return:

{"result": *, "hash": *, "nonce": *}

private _simulatedNextBlockMining(nextBlock: *) source

Params:

NameTypeAttributeDescription
nextBlock *