miner

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Miner

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

func NewMiner

func NewMiner(cfgFile string, chain PovChainReader, txPool PovTxPoolReader, cs PovConsensusReader) *Miner

func (*Miner) GetAccounts added in v1.4.0

func (miner *Miner) GetAccounts() []*types.Account

func (*Miner) GetChain added in v1.4.0

func (miner *Miner) GetChain() PovChainReader

func (*Miner) GetConfig

func (miner *Miner) GetConfig() *config.Config

func (*Miner) GetLogger

func (miner *Miner) GetLogger() *zap.SugaredLogger

func (*Miner) GetPovConsensus added in v1.4.0

func (miner *Miner) GetPovConsensus() PovConsensusReader

func (*Miner) GetSyncState

func (miner *Miner) GetSyncState() topic.SyncState

func (*Miner) GetTxPool added in v1.4.0

func (miner *Miner) GetTxPool() PovTxPoolReader

func (*Miner) Init

func (miner *Miner) Init() error

func (*Miner) Start

func (miner *Miner) Start() error

func (*Miner) Stop

func (miner *Miner) Stop() error

type PovChainReader added in v1.4.0

type PovChainReader interface {
	LatestHeader() *types.PovHeader
	LatestBlock() *types.PovBlock
	TransitStateDB(height uint64, txs []*types.PovTransaction, gsdb *statedb.PovGlobalStateDB) error
	CalcBlockReward(header *types.PovHeader) (types.Balance, types.Balance, error)
	CalcPastMedianTime(prevHeader *types.PovHeader) uint32
}

type PovConsensusReader added in v1.4.0

type PovConsensusReader interface {
	PrepareHeader(header *types.PovHeader) error
}

type PovMinerAlgoBlock added in v1.3.0

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

type PovTxPoolReader added in v1.4.0

type PovTxPoolReader interface {
	SelectPendingTxs(gsdb *statedb.PovGlobalStateDB, limit int) []*types.StateBlock
	LastUpdated() time.Time
	GetPendingTxNum() uint32
}

type PovWorker

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

func NewPovWorker

func NewPovWorker(cc *context.ChainContext, miner *Miner) *PovWorker

func (*PovWorker) GetAlgoType added in v1.4.0

func (w *PovWorker) GetAlgoType() types.PovAlgoType

func (*PovWorker) GetConfig

func (w *PovWorker) GetConfig() *config.Config

func (*PovWorker) GetMinerAccount added in v1.4.0

func (w *PovWorker) GetMinerAccount() *types.Account

func (*PovWorker) GetMinerAddress added in v1.4.0

func (w *PovWorker) GetMinerAddress() types.Address

func (*PovWorker) GetMiningInfo added in v1.3.0

func (w *PovWorker) GetMiningInfo(in interface{}, out interface{})

func (*PovWorker) GetWork added in v1.3.0

func (w *PovWorker) GetWork(in interface{}, out interface{})

func (*PovWorker) Init

func (w *PovWorker) Init() error

func (*PovWorker) OnEventRpcSyncCall added in v1.3.0

func (w *PovWorker) OnEventRpcSyncCall(msg *topic.EventRPCSyncCallMsg)

func (*PovWorker) Start

func (w *PovWorker) Start() error

func (*PovWorker) StartMining added in v1.4.0

func (w *PovWorker) StartMining(in interface{}, out interface{})

func (*PovWorker) Stop

func (w *PovWorker) Stop() error

func (*PovWorker) StopMining added in v1.4.0

func (w *PovWorker) StopMining(in interface{}, out interface{})

func (*PovWorker) SubmitWork added in v1.3.0

func (w *PovWorker) SubmitWork(in interface{}, out interface{})

Jump to

Keyboard shortcuts

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