deb

package
v0.7.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcDifficulty added in v0.6.12

func CalcDifficulty(joinNonce uint64, otprn []byte, coinbase common.Address, parentHash common.Hash) *big.Int

func MakeRand

func MakeRand(joinNonce uint64, otprn common.Hash, coinbase common.Address, pBlockHash common.Hash) int64

Types

type Deb

type Deb struct {
	// contains filtered or unexported fields
}

Deb is the proof-of-Deb consensus engine proposed to support the

func New

func New(config *params.DebConfig, db ethdb.Database) *Deb

New creates a andusChain proof-of-deb consensus engine with the initial signers set to the ones provided by the user.

func NewFakeDelayer added in v0.6.12

func NewFakeDelayer(delay time.Duration) *Deb

func NewFakeFailer added in v0.6.12

func NewFakeFailer(fail uint64) *Deb

func NewFaker added in v0.6.12

func NewFaker() *Deb

func NewFullFaker added in v0.6.12

func NewFullFaker() *Deb

func (*Deb) APIs

func (c *Deb) APIs(chain consensus.ChainReader) []rpc.API

APIs implements consensus.Engine, returning the user facing RPC API to allow controlling the signer voting.

func (*Deb) Author

func (c *Deb) Author(header *types.Header) (common.Address, error)

Author implements consensus.Engine, returning the Ethereum address recovered from the signature in the header's extra-data section.

func (*Deb) CalcDifficulty

func (c *Deb) CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Header) *big.Int

CalcDifficulty is the difficulty adjustment algorithm. It returns the difficulty that a new block should have based on the previous blocks in the chain and the current signer.

func (*Deb) ChangeJoinNonceAndReword

func (c *Deb) ChangeJoinNonceAndReword(chainid *big.Int, state *state.StateDB, txs []*types.Transaction, header *types.Header) error

채굴자 보상 : JOINTX 갯수만큼 100% 지금 > TODO : optrn에 부여된 수익율 만큼 지급함

func (*Deb) Close

func (c *Deb) Close() error

Close implements consensus.Engine. It's a noop for clique as there is are no background threads.

func (*Deb) Finalize

func (c *Deb) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, Txs []*types.Transaction, receipts []*types.Receipt, voters []*types.Voter) (*types.Block, error)

Finalize implements consensus.Engine, ensuring no uncles are set, nor block rewards given, and returns the final block.

func (*Deb) Prepare

func (c *Deb) Prepare(chain consensus.ChainReader, header *types.Header) error

Prepare implements consensus.Engine, preparing all the consensus fields of the header for running the transactions on top.

func (*Deb) Seal

func (c *Deb) Seal(chain consensus.ChainReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error

Seal implements consensus.Engine, attempting to create a sealed block using the local signing credentials.

func (*Deb) SealHash

func (c *Deb) SealHash(header *types.Header) common.Hash

SealHash returns the hash of a block prior to it being sealed.

func (*Deb) SelectWinningBlock added in v0.6.12

func (c *Deb) SelectWinningBlock(pblock, rblock *types.Block) *types.Block

pblock > possibeblock, rblock > received block

func (*Deb) SetCoinbase added in v0.6.12

func (c *Deb) SetCoinbase(coinbase common.Address)

func (*Deb) SetOtprn added in v0.6.12

func (c *Deb) SetOtprn(otprn *types.Otprn)

func (*Deb) ValidationLeagueBlock added in v0.6.12

func (c *Deb) ValidationLeagueBlock(chain consensus.ChainReader, block *types.Block) error

func (*Deb) VerifyFairnodeSign added in v0.6.12

func (c *Deb) VerifyFairnodeSign(header *types.Header) error

validation fairnode signature

func (*Deb) VerifyHeader

func (c *Deb) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error

VerifyHeader checks whether a header conforms to the consensus rules.

func (*Deb) VerifyHeaders

func (c *Deb) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)

VerifyHeaders is similar to VerifyHeader, but verifies a batch of headers. The method returns a quit channel to abort the operations and a results channel to retrieve the async verifications (the order is that of the input slice).

func (*Deb) VerifySeal

func (c *Deb) VerifySeal(chain consensus.ChainReader, header *types.Header) error

VerifySeal implements consensus.Engine, checking whether the signature contained in the header satisfies the consensus protocol requirements.

type ErrorType

type ErrorType int

type PrivateDebApi added in v0.7.3

type PrivateDebApi struct {
	// contains filtered or unexported fields
}

API is a user facing RPC API to allow controlling the signer and voting mechanisms of the proof-of-deb scheme.

func NewPrivateDebApi added in v0.7.3

func NewPrivateDebApi(chain consensus.ChainReader, deb *Deb) *PrivateDebApi

func (*PrivateDebApi) GetFairnodePubKey added in v0.7.3

func (api *PrivateDebApi) GetFairnodePubKey() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL