Documentation
¶
Index ¶
- func CalcBlockPoc(header *types.Header) *types.BlockPoc
- func CalcDeadline(scoopDataBytes []byte, genSigBytes []byte, baseTarget *big.Int) *big.Int
- func CalcDifficulty(header *types.Header, ancestorHeaders []*types.Header) *big.Int
- func CalcGenerationSignature(lastGenSigBytes []byte, lastGeneratorBytes []byte) []byte
- func CalcHit(scoopDataBytes []byte, genSigBytes []byte) *big.Int
- func CalcScoop(genSigBytes []byte, height uint64) uint64
- type MineResult
- type Poc
- func (poc *Poc) APIs(chain consensus.ChainReader) []rpc.API
- func (poc *Poc) Author(header *types.Header) (common.Address, error)
- func (poc *Poc) CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Header) *big.Int
- func (poc *Poc) Config() *params.PocConfig
- func (poc *Poc) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, ...) (*types.Block, error)
- func (poc *Poc) GetSize() uint64
- func (poc *Poc) Prepare(chain consensus.ChainReader, header *types.Header) error
- func (poc *Poc) Seal(chain consensus.ChainReader, block *types.Block, stop <-chan struct{}) (*types.Block, error)
- func (poc *Poc) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error
- func (poc *Poc) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)
- func (poc *Poc) VerifySeal(chain consensus.ChainReader, header *types.Header) error
- func (poc *Poc) VerifyUncles(chain consensus.ChainReader, block *types.Block) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcDeadline ¶
func CalcDifficulty ¶
func CalcGenerationSignature ¶
Types ¶
type MineResult ¶
type MineResult struct {
// contains filtered or unexported fields
}
type Poc ¶
type Poc struct {
// contains filtered or unexported fields
}
func (*Poc) Author ¶
Author implements consensus.Engine, returning the header's coinbase as the proof-of-capacity verified author of the block.
func (*Poc) CalcDifficulty ¶
func (*Poc) Finalize ¶
func (poc *Poc) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error)
Finalize implements consensus.Engine, accumulating the block and uncle rewards, setting the final state and assembling the block.
func (*Poc) Prepare ¶
Prepare implements consensus.Engine, initializing the difficulty field of a header to conform to the poc protocol. The changes are done inline.
func (*Poc) VerifyHeader ¶
VerifyHeader checks whether a header conforms to the consensus rules of the poc engine.
func (*Poc) VerifyHeaders ¶
func (poc *Poc) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)
VerifyHeaders is similar to VerifyHeader, but verifies a batch of headers concurrently. The method returns a quit channel to abort the operations and a results channel to retrieve the async verifications.
func (*Poc) VerifySeal ¶
VerifySeal implements consensus.Engine, checking whether the given block satisfies the PoC difficulty requirements.
func (*Poc) VerifyUncles ¶
VerifyUncles verifies that the given block's uncles conform to the consensus rules of the poc engine.