Documentation ¶
Index ¶
Constants ¶
View Source
const ( // EventProposedBlock represent an event about a // block to be mined. EventProposedBlock = "event.proposedBlock" // EventFoundBlock represents an event about // a block with a valid PoW nonce EventFoundBlock = "event.foundBlock" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FoundBlock ¶
type FoundBlock struct {
// contains filtered or unexported fields
}
FoundBlock represents a block with a valid nonce
type Miner ¶
Miner provides proof-of-work computation, difficulty calculation and prepares a mine block for processing.
func NewMiner ¶
func NewMiner(mineKey *crypto.Key, blockMaker types.BlockMaker, event *emitter.Emitter, cfg *config.EngineConfig, log logger.Logger) *Miner
NewMiner creates a Miner instance
func (*Miner) OnNewBlock ¶
func (m *Miner) OnNewBlock(newBlock *core.Block, chain types.ChainReader)
OnNewBlock is called when a new block has been appended to the main chain. We must restart a new mining round.
func (*Miner) SetNumThreads ¶
SetNumThreads sets the number of threads performing PoW computation
Click to show internal directories.
Click to hide internal directories.