Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type VoteJournal ¶
type VoteJournal struct {
// contains filtered or unexported fields
}
func NewVoteJournal ¶
func NewVoteJournal(filePath string) (*VoteJournal, error)
func (*VoteJournal) ReadVote ¶
func (journal *VoteJournal) ReadVote(index uint64) (*types.VoteEnvelope, error)
func (*VoteJournal) WriteVote ¶
func (journal *VoteJournal) WriteVote(voteMessage *types.VoteEnvelope) error
type VoteManager ¶
type VoteManager struct {
// contains filtered or unexported fields
}
VoteManager will handle the vote produced by self.
func NewVoteManager ¶
func NewVoteManager(eth Backend, chain *core.BlockChain, pool *VotePool, journalPath, blsPasswordPath, blsWalletPath string, engine consensus.PoSA) (*VoteManager, error)
func (*VoteManager) UnderRules ¶
UnderRules checks if the produced header under the following rules: A validator must not publish two distinct votes for the same height. (Rule 1) A validator must not vote within the span of its other votes . (Rule 2) Validators always vote for their canonical chain’s latest block. (Rule 3)
type VotePool ¶
type VotePool struct {
// contains filtered or unexported fields
}
func NewVotePool ¶
func NewVotePool(chain *core.BlockChain, engine consensus.PoSA) *VotePool
func (*VotePool) FetchVoteByBlockHash ¶
func (pool *VotePool) FetchVoteByBlockHash(blockHash common.Hash) []*types.VoteEnvelope
func (*VotePool) GetVotes ¶
func (pool *VotePool) GetVotes() []*types.VoteEnvelope
GetVotes as batch.
func (*VotePool) PutVote ¶
func (pool *VotePool) PutVote(vote *types.VoteEnvelope)
func (*VotePool) SubscribeNewVoteEvent ¶
func (pool *VotePool) SubscribeNewVoteEvent(ch chan<- core.NewVoteEvent) event.Subscription
type VoteSigner ¶
type VoteSigner struct { PubKey [48]byte // contains filtered or unexported fields }
func NewVoteSigner ¶
func NewVoteSigner(blsPasswordPath, blsWalletPath string) (*VoteSigner, error)
func (*VoteSigner) SignVote ¶
func (signer *VoteSigner) SignVote(vote *types.VoteEnvelope) error
Click to show internal directories.
Click to hide internal directories.