Documentation
¶
Index ¶
- Variables
- func PrintableOutputTask(task *Task) map[string]interface{}
- type Miner
- func (miner *Miner) GetCoinbase() common.Address
- func (miner *Miner) GetCurrentWorkHeader() (header *types.BlockHeader)
- func (miner *Miner) GetEngine() consensus.Engine
- func (miner *Miner) GetTaskDifficulty() *big.Int
- func (miner *Miner) GetWork() map[string]interface{}
- func (miner *Miner) GetWorkTask() *Task
- func (miner *Miner) IsMining() bool
- func (miner *Miner) SetCoinbase(coinbase common.Address)
- func (miner *Miner) SetThreads(threads int)
- func (miner *Miner) Start() error
- func (miner *Miner) Stop()
- type Result
- type SeeleBackend
- type Task
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMinerIsRunning is returned when miner is running ErrMinerIsRunning = errors.New("miner is running") // ErrMinerIsStopped is returned when miner is stopped ErrMinerIsStopped = errors.New("miner is stopped") // ErrNodeIsSyncing is returned when the node is syncing ErrNodeIsSyncing = errors.New("can not start miner when syncing") )
Functions ¶
func PrintableOutputTask ¶ added in v1.3.0
Types ¶
type Miner ¶
type Miner struct {
// contains filtered or unexported fields
}
Miner defines base elements of miner
func NewMiner ¶
func NewMiner(addr common.Address, seele SeeleBackend, verifier types.DebtVerifier, engine consensus.Engine) *Miner
NewMiner constructs and returns a miner instance
func (*Miner) GetCoinbase ¶
func (*Miner) GetCurrentWorkHeader ¶ added in v1.3.0
func (miner *Miner) GetCurrentWorkHeader() (header *types.BlockHeader)
func (*Miner) GetTaskDifficulty ¶ added in v1.3.0
func (*Miner) GetWorkTask ¶ added in v1.3.0
func (*Miner) SetCoinbase ¶
SetCoinbase set the coinbase.
func (*Miner) SetThreads ¶
SetThreads sets the number of mining threads.
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result is the result mined by engine. It contains the raw task and mined block.
type SeeleBackend ¶
type SeeleBackend interface { TxPool() *core.TransactionPool BlockChain() *core.Blockchain DebtPool() *core.DebtPool }
SeeleBackend wraps all methods required for minier.
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
Task is a mining work for engine, containing block header, transactions, and transaction receipts.
func NewTask ¶
func NewTask(header *types.BlockHeader, coinbase common.Address, verifier types.DebtVerifier) *Task
NewTask return Task object
Click to show internal directories.
Click to hide internal directories.