progpow_go

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2020 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Overview

Package ethash implements the ethash proof-of-work consensus engine.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidDumpMagic = errors.New("invalid dump magic")

Functions

func SeedHash

func SeedHash(block uint64) []byte

SeedHash is the seed to use for generating a verification cache and the mining dataset.

Types

type Block

type Block interface {
	Difficulty() *big.Int
	HashNoNonce() common.Hash
	Nonce() uint64
	MixDigest() common.Hash
	NumberU64() uint64
}

type Config

type Config struct {
	CacheDir       string
	CachesInMem    int
	CachesOnDisk   int
	DatasetDir     string
	DatasetsInMem  int
	DatasetsOnDisk int
}

Config are the configuration parameters of the ethash.

type Ethash

type Ethash struct {
	// contains filtered or unexported fields
}

Ethash is a consensus engine based on proof-of-work implementing the ethash algorithm.

func New

func New() *Ethash

New creates a full sized ethash PoW scheme.

func (*Ethash) APIs

func (ethash *Ethash) APIs(chain consensus.ChainReader) []rpc.API

APIs implements consensus.Engine, returning the user facing RPC APIs. Currently that is empty.

func (*Ethash) Hashrate

func (ethash *Ethash) Hashrate() float64

Hashrate implements PoW, returning the measured rate of the search invocations per second over the last minute.

func (*Ethash) StartHashrate

func (ethash *Ethash) StartHashrate()

func (*Ethash) StopHashrate

func (ethash *Ethash) StopHashrate()

func (*Ethash) Threads

func (ethash *Ethash) Threads() int

Threads returns the number of mining threads currently enabled. This doesn't necessarily mean that mining is running!

func (*Ethash) Verify

func (ethash *Ethash) Verify(block Block) bool

VerifySeal implements consensus.Engine, checking whether the given block satisfies the PoW difficulty requirements.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL