Documentation ¶
Index ¶
- Variables
- func AccumulateRewards(config *params.ChainConfig, state *state.StateDB, header *types.Header, ...)
- func NextSlot(now int64) int64
- func PrevSlot(now int64) int64
- type API
- type Dpos
- func (d *Dpos) APIs(chain consensus.ChainReader) []rpc.API
- func (d *Dpos) Author(header *types.Header) (common.Address, error)
- func (d *Dpos) Authorize(signer common.Address, signFn SignerFn)
- func (d *Dpos) CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Header) *big.Int
- func (d *Dpos) CheckValidator(lastBlock *types.Block, now int64) error
- func (d *Dpos) Coinbase(header *types.Header) (common.Address, error)
- func (d *Dpos) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, ...) (*types.Block, error)
- func (d *Dpos) Prepare(chain consensus.ChainReader, header *types.Header) error
- func (d *Dpos) Seal(chain consensus.ChainReader, block *types.Block, stop <-chan struct{}) (*types.Block, error)
- func (d *Dpos) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error
- func (d *Dpos) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)
- func (d *Dpos) VerifySeal(chain consensus.ChainReader, header *types.Header) error
- func (d *Dpos) VerifyUncles(chain consensus.ChainReader, block *types.Block) error
- type EpochContext
- type SignerFn
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidTimestamp is returned if the timestamp of a block is lower than // the previous block's timestamp + the minimum block period. ErrInvalidTimestamp = errors.New("invalid timestamp") ErrWaitForPrevBlock = errors.New("wait for last block arrived") ErrMintFutureBlock = errors.New("mint the future block") ErrMismatchSignerAndValidator = errors.New("mismatch block signer and validator") ErrInvalidBlockValidator = errors.New("invalid block validator") ErrInvalidMintBlockTime = errors.New("invalid time to mint the block") ErrNilBlockHeader = errors.New("nil block header returned") )
Functions ¶
func AccumulateRewards ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is a user facing RPC API to allow controlling the delegate and voting mechanisms of the delegated-proof-of-stake
func (*API) GetConfirmedBlockNumber ¶
GetConfirmedBlockNumber retrieves the latest irreversible block
func (*API) GetValidators ¶
GetValidators retrieves the list of the validators at specified block
type Dpos ¶
type Dpos struct {
// contains filtered or unexported fields
}
func New ¶
func New(config *params.DposConfig, db ctxcdb.Database) *Dpos
func (*Dpos) CalcDifficulty ¶
func (*Dpos) CheckValidator ¶
func (*Dpos) Seal ¶
func (d *Dpos) Seal(chain consensus.ChainReader, block *types.Block, stop <-chan struct{}) (*types.Block, error)
Seal generates a new block for the given input block with the local miner's seal place on top.
func (*Dpos) VerifyHeader ¶
func (*Dpos) VerifyHeaders ¶
func (*Dpos) VerifySeal ¶
VerifySeal implements consensus.Engine, checking whether the signature contained in the header satisfies the consensus protocol requirements.
func (*Dpos) VerifyUncles ¶
VerifyUncles implements consensus.Engine, always returning an error for any uncles as this consensus mechanism doesn't permit uncles.
type EpochContext ¶
type EpochContext struct { TimeStamp int64 DposContext *types.DposContext // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.