pow

package
v0.0.0-...-9fbb145 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package consensus implements different Cypherium consensus engines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {

	// SealCandidate generates a new candidate with the local miner's seal place on top.
	SealCandidate(candidate *types.Candidate, stop <-chan struct{}) (*types.Candidate, error)

	// VerifyCandidate checks whether the crypto seal on a candidate is valid according to
	// the consensus rules of the given engine.
	VerifyCandidate(chain types.KeyChainReader, candidate *types.Candidate) error

	// Prepare initializes the consensus fields of a candidate according to the
	// rules of a particular engine. The changes are executed inline.
	PrepareCandidate(chain types.KeyChainReader, candidate *types.Candidate, CommitteeSize int) error

	// APIs returns the RPC APIs this consensus engine provides.
	APIs(chain types.ChainReader) []rpc.API

	CalcKeyBlockDifficulty(chain types.KeyChainReader, time uint64, parent *types.KeyBlockHeader) *big.Int
	PowMode() uint
}

Engine is an algorithm agnostic consensus engine.

type PoW

type PoW interface {
	Engine

	// Hashrate returns the current mining hashrate of a PoW consensus engine.
	Hashrate() float64
}

PoW is a consensus engine based on proof-of-work.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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