Documentation ¶
Index ¶
- Constants
- func MakeRand(joinNonce uint64, otprn common.Hash, coinbase common.Address, ...) int64
- func ValidationFairSignature(hash common.Hash, sig []byte, fairAddr common.Address) bool
- type API
- 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) ChangeJoinNonceAndReword(chainid *big.Int, state *state.StateDB, txs []*types.Transaction, ...)
- func (c *Deb) Close() error
- func (c *Deb) CompareBlock(myBlock, receivedBlock *fairtypes.VoteBlock) *fairtypes.VoteBlock
- func (c *Deb) FairNodeSigCheck(recivedBlock *types.Block, rSig []byte) (error, ErrorType)
- func (c *Deb) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, ...) (*types.Block, error)
- 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) SendMiningBlockAndVoting(chain consensus.ChainReader, tsfBlock *fairtypes.VoteBlock, isVoting *bool)
- func (c *Deb) SetChans(chans fairtypes.Channals)
- func (c *Deb) SetManager(manager client)
- func (c *Deb) SetSignKey(signKey *ecdsa.PrivateKey)
- func (c *Deb) SignBlockHeader(blockHash []byte) ([]byte, error)
- func (c *Deb) ValidateJointx(voteBlock *fairtypes.VoteBlock) bool
- func (c *Deb) ValidationBlockWidthJoinTx(chainid *big.Int, block *types.Block, joinNonce uint64) error
- func (c *Deb) ValidationVoteBlock(chain consensus.ChainReader, voteblock *types.Block) error
- func (c *Deb) ValidationVoteBlockSign(voteBlock *fairtypes.VoteBlock) bool
- 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
- func (c *Deb) VerifyUncles(chain consensus.ChainReader, block *types.Block) error
- type ErrorType
Constants ¶
const (
VotingWaitTime = 10 // 리그에서 블록 투표시 기다리는 시간
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API 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 (*API) GetFairnodeAddress ¶
func (*API) GetJoinNonce ¶
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 (*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) ChangeJoinNonceAndReword ¶
func (c *Deb) ChangeJoinNonceAndReword(chainid *big.Int, state *state.StateDB, txs []*types.Transaction, coinbase common.Address)
채굴자 보상 : JOINTX 갯수만큼 100% 지금
func (*Deb) Close ¶
Close implements consensus.Engine. It's a noop for clique as there is are no background threads.
func (*Deb) CompareBlock ¶
다른데서 받은 투표 블록을 비교하여 위닝 블록으로 교체 하는 함수
func (*Deb) FairNodeSigCheck ¶
func (*Deb) Finalize ¶
func (c *Deb) 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, 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) SendMiningBlockAndVoting ¶
func (*Deb) SetManager ¶
func (c *Deb) SetManager(manager client)
func (*Deb) SetSignKey ¶
func (c *Deb) SetSignKey(signKey *ecdsa.PrivateKey)
func (*Deb) SignBlockHeader ¶
TODO : andus >> 생성된 블록(브로드케스팅용) 서명
func (*Deb) ValidateJointx ¶
투표블록 서명 검증하고 난이도 검증
func (*Deb) ValidationBlockWidthJoinTx ¶
func (*Deb) ValidationVoteBlock ¶
func (*Deb) ValidationVoteBlockSign ¶
투표블록 서명 검증하고 난이도 검증
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.
func (*Deb) VerifyUncles ¶
VerifyUncles implements consensus.Engine, always returning an error for any uncles as this consensus mechanism doesn't permit uncles.