Documentation ¶
Index ¶
- type Miner
- func (miner *Miner) GetAccounts() []*types.Account
- func (miner *Miner) GetChain() PovChainReader
- func (miner *Miner) GetConfig() *config.Config
- func (miner *Miner) GetLogger() *zap.SugaredLogger
- func (miner *Miner) GetPovConsensus() PovConsensusReader
- func (miner *Miner) GetSyncState() topic.SyncState
- func (miner *Miner) GetTxPool() PovTxPoolReader
- func (miner *Miner) Init() error
- func (miner *Miner) Start() error
- func (miner *Miner) Stop() error
- type PovChainReader
- type PovConsensusReader
- type PovMinerAlgoBlock
- type PovTxPoolReader
- type PovWorker
- func (w *PovWorker) GetAlgoType() types.PovAlgoType
- func (w *PovWorker) GetConfig() *config.Config
- func (w *PovWorker) GetMinerAccount() *types.Account
- func (w *PovWorker) GetMinerAddress() types.Address
- func (w *PovWorker) GetMiningInfo(in interface{}, out interface{})
- func (w *PovWorker) GetWork(in interface{}, out interface{})
- func (w *PovWorker) Init() error
- func (w *PovWorker) OnEventRpcSyncCall(msg *topic.EventRPCSyncCallMsg)
- func (w *PovWorker) Start() error
- func (w *PovWorker) StartMining(in interface{}, out interface{})
- func (w *PovWorker) Stop() error
- func (w *PovWorker) StopMining(in interface{}, out interface{})
- func (w *PovWorker) SubmitWork(in interface{}, out interface{})
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) GetChain ¶ added in v1.4.0
func (miner *Miner) GetChain() PovChainReader
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) GetTxPool ¶ added in v1.4.0
func (miner *Miner) GetTxPool() PovTxPoolReader
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 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) GetMinerAccount ¶ added in v1.4.0
func (*PovWorker) GetMinerAddress ¶ added in v1.4.0
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) OnEventRpcSyncCall ¶ added in v1.3.0
func (w *PovWorker) OnEventRpcSyncCall(msg *topic.EventRPCSyncCallMsg)
func (*PovWorker) StartMining ¶ added in v1.4.0
func (w *PovWorker) StartMining(in interface{}, out interface{})
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{})
Click to show internal directories.
Click to hide internal directories.