pow

package
v0.0.0-...-77b6ffe Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Miner      bool
	PrivKey    []byte
	GasLimit   uint64
	Difficulty uint64
}

type ProofOfWork

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

ProofOfWork implements proof-of-work consensus algorithm.

func New

func New(config *common.Config, state *state.StateDB, chain chain.Blockchain) (*ProofOfWork, error)

func (*ProofOfWork) Addr

func (pow *ProofOfWork) Addr() common.Address

func (*ProofOfWork) Finalize

func (pow *ProofOfWork) Finalize(header *types.Header, state *state.StateDB, txs types.Transactions, receipts types.Receipts) (*types.Block, error)

func (*ProofOfWork) Protocols

func (pow *ProofOfWork) Protocols() []common.Protocol

func (*ProofOfWork) Start

func (pow *ProofOfWork) Start() error

func (*ProofOfWork) Stop

func (pow *ProofOfWork) Stop() error

Jump to

Keyboard shortcuts

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