Home Reference Source
public class | source

BlockchainBackboneMining

Extends:

InterfaceBlockchainMiningBasicInterfaceBlockchainMining → BlockchainBackboneMining

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
public

block: *

public
public
public
Private Members
private
private

Method Summary

Public Methods
public

async mine(block: *, difficulty: *, start: *, end: *): *

public
Private Methods
private

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

private

async _mineNoncesWithWorkers(start: *, end: *): *

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
From class InterfaceBlockchainMining
public
public
public

block: *

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

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

private

Public Constructors

public constructor() source

Override:

InterfaceBlockchainMining#constructor

Public Members

public WORKER_NONCES_WORK: number source

public bestHash: * source

Override:

InterfaceBlockchainMining#bestHash

public bestHashNonce: * source

Override:

InterfaceBlockchainMining#bestHashNonce

public block: * source

Override:

InterfaceBlockchainMining#block

public difficulty: * source

Override:

InterfaceBlockchainMining#difficulty

public end: number source

public undefined: * source

Private Members

private _workerResolve: * source

private _workers: * source

Public Methods

public async mine(block: *, difficulty: *, start: *, end: *): * source

Simple Mining with no Workers

Override:

InterfaceBlockchainMining#mine

Params:

NameTypeAttributeDescription
block *
difficulty *
start *
end *

Return:

*

public stopMining() source

Override:

InterfaceBlockchainMiningBasic#stopMining

Private Methods

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

Override:

InterfaceBlockchainMining#_mineNonces

Params:

NameTypeAttributeDescription
start *
end *

Return:

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

private async _mineNoncesWithWorkers(start: *, end: *): * source

Params:

NameTypeAttributeDescription
start *
end *

Return:

*