@ethereumjs/ethash / Miner
Defined in: index.ts:47
new Miner(
mineObject
,ethash
):Miner
Defined in: index.ts:64
Create a Miner object
The object to mine on, either a BlockHeader
or a Block
object
BlockHeader |
Block |
Ethash object to use for mining
Miner
optional
solution:Solution
Defined in: index.ts:52
iterate(
iterations
):Promise
<undefined
|Solution
>
Defined in: index.ts:114
Iterate iterations
times over nonces to find a valid PoW. Caches solution if one is found
number
= 0
Number of iterations to iterate over. If -1
is passed, the loop runs until a solution is found
Promise
<undefined
| Solution
>
undefined
if no solution was found, or otherwise a Solution
objectmine(
iterations
):Promise
<undefined
|BlockHeader
|Block
>
Defined in: index.ts:91
Iterate iterations
time over nonces, returns a BlockHeader
or Block
if a solution is found, undefined
otherwise
number
= 0
Number of iterations to iterate over. If -1
is passed, the loop runs until a solution is found
Promise
<undefined
| BlockHeader
| Block
>
undefined
if no solution was found within the iterations, or a BlockHeader
or Block
with valid PoW based upon what was passed in the constructorstop():
void
Defined in: index.ts:81
Stop the miner on the next iteration
void