Documentation ¶
Index ¶
- type API
- type ZpowEngine
- func (engine *ZpowEngine) APIs(chain consensus.ChainReader) []rpc.API
- func (engine *ZpowEngine) Prepare(reader consensus.ChainReader, header *types.BlockHeader) error
- func (engine *ZpowEngine) Seal(reader consensus.ChainReader, block *types.Block, stop <-chan struct{}, ...) error
- func (engine *ZpowEngine) SetGpuBlocksThreads(blocks int, threads int)
- func (engine *ZpowEngine) SetThreads(threads int)
- func (engine *ZpowEngine) StartMining(block *types.Block, seed uint64, min uint64, max uint64, ...)
- func (engine *ZpowEngine) StartMiningGpu(block *types.Block, seed uint64, min uint64, max uint64, ...)
- func (engine *ZpowEngine) VerifyHeader(reader consensus.ChainReader, header *types.BlockHeader) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) GetDetrate ¶
GetDetrate returns the current detrate for local CPU miner and remote miner.
func (*API) GetThreads ¶
GetThreads returns the thread number of the miner engine
type ZpowEngine ¶
type ZpowEngine struct {
// contains filtered or unexported fields
}
Engine provides the consensus operations based on ZPOW.
func NewZpowEngine ¶
func NewZpowEngine(threads int) *ZpowEngine
func (*ZpowEngine) APIs ¶
func (engine *ZpowEngine) APIs(chain consensus.ChainReader) []rpc.API
APIs returns the miner rpc apis
func (*ZpowEngine) Prepare ¶
func (engine *ZpowEngine) Prepare(reader consensus.ChainReader, header *types.BlockHeader) error
Prepare sets the difficulty for the block to be mined
func (*ZpowEngine) Seal ¶
func (engine *ZpowEngine) Seal(reader consensus.ChainReader, block *types.Block, stop <-chan struct{}, results chan<- *types.Block) error
Seal partitions the nonces for the threads and let the threads mine in parallel
func (*ZpowEngine) SetGpuBlocksThreads ¶
func (engine *ZpowEngine) SetGpuBlocksThreads(blocks int, threads int)
func (*ZpowEngine) SetThreads ¶
func (engine *ZpowEngine) SetThreads(threads int)
SetThreads sets the number of threads used for mining
func (*ZpowEngine) StartMining ¶
func (*ZpowEngine) StartMiningGpu ¶
func (engine *ZpowEngine) StartMiningGpu(block *types.Block, seed uint64, min uint64, max uint64, result chan<- *types.Block, abort <-chan struct{}, isNonceFound *int32, once *sync.Once, detrate metrics.Meter, log *log.ScdoLog)
StartMining is the core mining rountine
func (*ZpowEngine) VerifyHeader ¶
func (engine *ZpowEngine) VerifyHeader(reader consensus.ChainReader, header *types.BlockHeader) error
VerifyHeader validates the specified header and returns error if validation failed.
Click to show internal directories.
Click to hide internal directories.