Home Reference Source
public class | source

Workers

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

block: *

public

blockId: *

public
public

height: *

public

ibb: *

public
public
public
public
public
Private Members
private
private
private
private
private
private
private
private
private

_silent: *

private
private
private

Method Summary

Public Methods
public
public

max(): *

public

async run(start: *, end: *, loop_delay: number)

public
Private Methods
private

async _createWorker(index: *): *

private

async _initializeWorker(index: *)

private

async _initiateWorkers(): *

private

async _loop(_delay: *): boolean

private
private
private

_stop()

private

_stopAndResolve(result: boolean, hash: *, nonce: *): *

private

async _validateHash(initialHash: *, nonce: *): boolean

Public Constructors

public constructor(ibb: BlockchainBackboneMining): Workers source

Params:

NameTypeAttributeDescription
ibb BlockchainBackboneMining

Return:

Workers

Public Members

public block: * source

public blockId: * source

public difficulty: * source

public height: * source

public ibb: * source

public makeUnresponsiveThreadsTimeout: * source

public worker_batch: * source

public worker_batch_thread: * source

public workers_list: *[] source

public workers_max: * source

Private Members

private _abs_end: number source

private _current: * source

private _current_max: * source

private _final_batch: boolean source

private _finished: boolean source

private _from_pool: * source

private _loopTimeout: * source

private _run_timeout: boolean source

private _silent: * source

private _worker_path: * source

private _worker_path_file_name: string source

private _working: number source

Public Methods

public haveSupport(): boolean source

Return:

boolean

public max(): * source

Return:

*

public async run(start: *, end: *, loop_delay: number) source

Params:

NameTypeAttributeDescription
start *
end *
loop_delay number
  • optional
  • default: 2

public stopMining() source

Private Methods

private async _createWorker(index: *): * source

Params:

NameTypeAttributeDescription
index *

Return:

*

private async _initializeWorker(index: *) source

Params:

NameTypeAttributeDescription
index *

private async _initiateWorkers(): * source

Return:

*

private async _loop(_delay: *): boolean source

Params:

NameTypeAttributeDescription
_delay *

Return:

boolean

private async _makeUnresponsiveThreads() source

private _maxWorkersDefault(): * source

Return:

*

private _stop() source

private _stopAndResolve(result: boolean, hash: *, nonce: *): * source

Params:

NameTypeAttributeDescription
result boolean
  • optional
  • default: false
hash *
  • optional
  • default: undefined
nonce *
  • optional
  • default: undefined

Return:

*

private async _validateHash(initialHash: *, nonce: *): boolean source

Params:

NameTypeAttributeDescription
initialHash *
nonce *

Return:

boolean