miner

package
v0.0.1-unstable Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: GPL-3.0 Imports: 24 Imported by: 1

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 dpos related methods for the RPC interface.

func (*API) Mining

func (api *API) Mining() bool

func (*API) SetCoinbase

func (api *API) SetCoinbase(name string, privKey string) error

func (*API) SetExtra

func (api *API) SetExtra(extra []byte) error

func (*API) Start

func (api *API) Start() bool

func (*API) Stop

func (api *API) Stop() bool

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

func (*Miner) Mining

func (miner *Miner) Mining() bool

Mining wroker is wroking

func (*Miner) Pending

func (miner *Miner) Pending() (*types.Block, *state.StateDB)

Pending returns the currently pending block and associated state.

func (*Miner) SetCoinbase

func (miner *Miner) SetCoinbase(name string, privKey *ecdsa.PrivateKey)

SetCoinbase coinbase name & private key

func (*Miner) SetExtra

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

SetExtra extra data

func (*Miner) Start

func (miner *Miner) Start()

Start start worker

func (*Miner) Stop

func (miner *Miner) Stop()

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