Documentation ¶
Index ¶
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 ¶
This section is empty.
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) 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 GenesisInfo() core.GenesisInfo GetAccountIndexDB() database.Database GetIndexAccountDB() database.Database }
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.