Documentation ¶
Index ¶
- func MakeRand(joinNonce uint64, otprn common.Hash, coinbase common.Address, ...) int64
- type Deb
- func (c *Deb) APIs(chain consensus.ChainReader) []rpc.API
- func (c *Deb) Author(header *types.Header) (common.Address, error)
- func (c *Deb) CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Header) *big.Int
- func (c *Deb) CalcDifficultyDeb(joinNonce uint64, otprn []byte, coinbase common.Address, ...) *big.Int
- func (c *Deb) ChangeJoinNonceAndReword(chainid *big.Int, state *state.StateDB, txs []*types.Transaction, ...) error
- func (c *Deb) Close() error
- func (c *Deb) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, ...) (*types.Block, error)
- func (c *Deb) Name() string
- func (c *Deb) Otprn() *types.Otprn
- func (c *Deb) Prepare(chain consensus.ChainReader, header *types.Header) error
- func (c *Deb) Seal(chain consensus.ChainReader, block *types.Block, results chan<- *types.Block, ...) error
- func (c *Deb) SealHash(header *types.Header) common.Hash
- func (c *Deb) SelectWinningBlock(pblock, rblock *types.Block) *types.Block
- func (c *Deb) SetCoinbase(coinbase common.Address)
- func (c *Deb) SetOtprn(otprn *types.Otprn)
- func (c *Deb) ValidationLeagueBlock(chain consensus.ChainReader, block *types.Block) error
- func (c *Deb) VerifyFairnodeSign(header *types.Header) error
- func (c *Deb) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error
- func (c *Deb) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)
- func (c *Deb) VerifySeal(chain consensus.ChainReader, header *types.Header) error
- type ErrorType
- type PrivateDebApi
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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 NewFullFaker ¶ added in v0.6.12
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 ¶
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) CalcDifficultyDeb ¶ added in v0.8.1
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 ¶
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 ¶
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) SelectWinningBlock ¶ added in v0.6.12
pblock > possibeblock, rblock > received block
func (*Deb) SetCoinbase ¶ added in v0.6.12
func (*Deb) ValidationLeagueBlock ¶ added in v0.6.12
func (*Deb) VerifyFairnodeSign ¶ added in v0.6.12
validation fairnode signature
func (*Deb) VerifyHeader ¶
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 ¶
VerifySeal implements consensus.Engine, checking whether the signature contained in the header satisfies the consensus protocol requirements.
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) FairnodePubKey ¶ added in v0.8.1
func (api *PrivateDebApi) FairnodePubKey() string