Documentation ¶
Overview ¶
Package miner provides a basic miner for sunyata, suitable for testing and as a basis for more sophisticated implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CPU cpuGrinder
CPU grinds nonces with a single CPU thread.
Functions ¶
This section is empty.
Types ¶
type Miner ¶
type Miner struct {
// contains filtered or unexported fields
}
A Miner mines blocks.
func (*Miner) ProcessChainApplyUpdate ¶
func (m *Miner) ProcessChainApplyUpdate(cau *chain.ApplyUpdate, _ bool) error
ProcessChainApplyUpdate implements chain.Subscriber.
func (*Miner) ProcessChainRevertUpdate ¶
func (m *Miner) ProcessChainRevertUpdate(cru *chain.RevertUpdate) error
ProcessChainRevertUpdate implements chain.Subscriber.
type NonceGrinder ¶
type NonceGrinder interface {
GrindNonce(h *sunyata.BlockHeader, target sunyata.BlockID)
}
A NonceGrinder sets the value of h.Nonce such that h.ID().MeetsTarget(target) returns true.
Click to show internal directories.
Click to hide internal directories.