@ethereumjs/ethash / Ethash
• new Ethash(cacheDB?
)
Name | Type |
---|---|
cacheDB? |
DB <number , DBObject > |
• cache: Uint8Array
[]
• Optional
cacheDB: DB
<number
, DBObject
>
• Optional
cacheSize: number
• dbOpts: Object
• Optional
epoc: number
• Optional
fullSize: number
• Optional
seed: Uint8Array
▸ _verifyPOW(header
): Promise
<boolean
>
Name | Type |
---|---|
header |
BlockHeader |
Promise
<boolean
>
▸ cacheHash(): Uint8Array
Uint8Array
▸ calcDatasetItem(i
): Uint8Array
Name | Type |
---|---|
i |
number |
Uint8Array
▸ getMiner(mineObject
): Miner
Returns a Miner
object
To mine a BlockHeader
or Block
, use the one-liner await ethash.getMiner(block).mine(-1)
Name | Type | Description |
---|---|---|
mineObject |
BlockHeader | Block |
Object to mine on, either a BlockHeader or a Block |
- A miner object
▸ headerHash(rawHeader
): Uint8Array
Name | Type |
---|---|
rawHeader |
Uint8Array [] |
Uint8Array
▸ loadEpoc(number
): Promise
<void
>
Loads the seed and cache given a block number.
Name | Type |
---|---|
number |
bigint |
Promise
<void
>
▸ mkcache(cacheSize
, seed
): Uint8Array
[]
Name | Type |
---|---|
cacheSize |
number |
seed |
Uint8Array |
Uint8Array
[]
▸ run(val
, nonce
, fullSize?
): Object
Name | Type |
---|---|
val |
Uint8Array |
nonce |
Uint8Array |
fullSize? |
number |
Object
Name | Type |
---|---|
hash |
Uint8Array |
mix |
Uint8Array |
▸ verifyPOW(block
): Promise
<boolean
>
Name | Type |
---|---|
block |
Block |
Promise
<boolean
>