miner

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: LGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package miner implements Ethereum block creation and mining.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	BlockChain() *core.BlockChain
	TxPool() *core.TxPool
}

Backend wraps all methods required for mining.

type Config

type Config struct {
	Etherbase common.Address `toml:",omitempty"` // Public address for block mining rewards (default = first account)
}

Config is the configuration parameters of mining.

type Miner

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

func New

func New(eth Backend, config *Config, chainConfig *params.ChainConfig, mux *event.TypeMux, engine consensus.Engine, clock *mockable.Clock) *Miner

func (*Miner) GenerateBlock added in v0.8.5

func (miner *Miner) GenerateBlock() (*types.Block, error)

func (*Miner) SetEtherbase

func (miner *Miner) SetEtherbase(addr common.Address)

func (*Miner) SubscribePendingLogs added in v0.8.5

func (miner *Miner) SubscribePendingLogs(ch chan<- []*types.Log) event.Subscription

SubscribePendingLogs starts delivering logs from pending transactions to the given channel.

Jump to

Keyboard shortcuts

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