Miner
Extends:
Constructor Summary
Public Constructor | ||
public |
constructor(address: *, intensity: *, autostart: *) |
Member Summary
Public Members | ||
public |
address: * |
|
public get |
|
|
public |
mineStop: * |
|
public |
|
|
public |
|
|
public |
workerPath: * |
Method Summary
Public Methods | ||
public |
findBlockHash(block: *, difficulty: *): Promise Find block hash according to difficulty |
|
public |
async mine(job: *, lastValidBlock: *) |
|
public |
async mineBlock(transactions: *, lastBlock: *, difficulty: *, address: *): * Mine a block in separate process |
|
public |
onBlockAdded(): * keep node(s) in sync |
|
public |
async start() |
|
public |
stop() |
Public Constructors
public constructor(address: *, intensity: *, autostart: *) source
Params:
Name | Type | Attribute | Description |
address | * | ||
intensity | * | ||
autostart | * |
Public Methods
public findBlockHash(block: *, difficulty: *): Promise source
Find block hash according to difficulty
Params:
Name | Type | Attribute | Description |
block | * | ||
difficulty | * |
public async mine(job: *, lastValidBlock: *) source
Params:
Name | Type | Attribute | Description |
job | * | ||
lastValidBlock | * |
public async mineBlock(transactions: *, lastBlock: *, difficulty: *, address: *): * source
Mine a block in separate process
Params:
Name | Type | Attribute | Description |
transactions | * | Transactions list to add to the block |
|
lastBlock | * | Last block in the blockchain |
|
difficulty | * | Current difficulty |
|
address | * | Addres for reward transaction |
Return:
* |