miner

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTxPoolConfig is returned when the miner's txpool is misconfigured.
	ErrTxPoolConfig = errors.New("txpool is misconfigured: cannot start miner")
)

Functions

This section is empty.

Types

type Miner

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

Miner produces new blocks, adds them to the chain and notifies other participants of the blocks it produces.

func NewMiner

NewMiner creates a new miner that will start mining on the given chain. To stop the miner, you should cancel the input context.

func (*Miner) IsRunning

func (m *Miner) IsRunning() bool

IsRunning returns whether the miner is running or not.

func (*Miner) Start

func (m *Miner) Start(ctx context.Context) error

Start starts mining to produce blocks.

Jump to

Keyboard shortcuts

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