Documentation ¶
Index ¶
- Constants
- type DefaultWork
- func (work *DefaultWork) CalBlockRlpWithoutNonce()
- func (work *DefaultWork) CalHash() (common.Hash, error)
- func (work *DefaultWork) FillSealResult(curBlock model.AbstractBlock) error
- func (work *DefaultWork) GetWorkerCoinbaseAddress() common.Address
- func (work *DefaultWork) SetWorkerCoinbaseAddress(address common.Address)
- func (work *DefaultWork) Split(count int) (result []*DefaultWork)
- type DefaultWorkBuilder
- type Register
- type SetCurrentCoinbase
- type Work
Constants ¶
View Source
const ( // msg sent to worker by master StartMineMsg = 0x1 StopMineMsg = 0x2 WaitForCommitMsg = 0x3 // work msg(one dispatch, one submit) NewDefaultWorkMsg = 0x10 SubmitDefaultWorkMsg = 0x11 // msg sent to master by worker RegisterMsg = 0x50 UnRegisterMsg = 0x51 SetCurrentCoinbaseMsg = 0x52 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultWork ¶
type DefaultWork struct { WorkerCoinbaseAddress common.Address // add block header for mining // the first 4 bytes of the nonce value is assigned by the sharding server, // and the next 4 assigned by the worker. The rest is accomplished by the miner. BlockHeader model.Header ResultNonce common.BlockNonce //pre-calculate rlp RlpPreCal []byte }
func (*DefaultWork) CalBlockRlpWithoutNonce ¶
func (work *DefaultWork) CalBlockRlpWithoutNonce()
func (*DefaultWork) FillSealResult ¶
func (work *DefaultWork) FillSealResult(curBlock model.AbstractBlock) error
func (*DefaultWork) GetWorkerCoinbaseAddress ¶
func (work *DefaultWork) GetWorkerCoinbaseAddress() common.Address
func (*DefaultWork) SetWorkerCoinbaseAddress ¶
func (work *DefaultWork) SetWorkerCoinbaseAddress(address common.Address)
func (*DefaultWork) Split ¶
func (work *DefaultWork) Split(count int) (result []*DefaultWork)
split the work into several slices
type DefaultWorkBuilder ¶
type DefaultWorkBuilder struct{}
func MakeDefaultWorkBuilder ¶
func MakeDefaultWorkBuilder() *DefaultWorkBuilder
func (*DefaultWorkBuilder) BuildWorks ¶
func (builder *DefaultWorkBuilder) BuildWorks(newBlock model.AbstractBlock, workerLen int) (workMsgCode int, works []Work)
type SetCurrentCoinbase ¶
Click to show internal directories.
Click to hide internal directories.