miner

package
v0.0.0-...-471f645 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API exposes miner related methods for the RPC interface.

func (*API) Force

func (api *API) Force() bool

Force force mint

func (*API) Mining

func (api *API) Mining() bool

Mining get miner's status

func (*API) SetCoinbase

func (api *API) SetCoinbase(name string, privKeys []string) error

SetCoinbase bind miner name & privkey of node

func (*API) SetDelay

func (api *API) SetDelay(delayDuration uint64) error

SetDelay delay broacast block when mint block

func (*API) SetExtra

func (api *API) SetExtra(extra string) error

SetExtra set extra data for miner

func (*API) Start

func (api *API) Start() bool

Start start mining

func (*API) Stop

func (api *API) Stop() bool

Stop stop mining

type Miner

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

Miner creates blocks and searches for proof values.

func NewMiner

func NewMiner(consensus consensus.IConsensus) *Miner

NewMiner creates a miner.

func (*Miner) APIs

func (miner *Miner) APIs(chain consensus.IChainReader) []rpc.API

APIs provide the miner RPC API.

func (*Miner) Mining

func (miner *Miner) Mining() bool

Mining wroker is wroking

func (*Miner) SetCoinbase

func (miner *Miner) SetCoinbase(name string, privKeys []string) error

SetCoinbase coinbase name & private key

func (*Miner) SetDelayDuration

func (miner *Miner) SetDelayDuration(delayDuration uint64) error

SetDelayDuration delay broacast block when mint block (unit:ms)

func (*Miner) SetExtra

func (miner *Miner) SetExtra(extra []byte) error

SetExtra extra data

func (*Miner) Start

func (miner *Miner) Start(force bool) bool

Start start worker

func (*Miner) Stop

func (miner *Miner) Stop() bool

Stop stop worker

type Work

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

type Worker

type Worker struct {
	consensus.IConsensus
	// contains filtered or unexported fields
}

Worker is the main object which takes care of applying messages to the new state

Jump to

Keyboard shortcuts

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