Documentation ¶
Index ¶
Constants ¶
View Source
const (
MaxMiner = 10000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Candidate ¶
type Candidate struct {
// contains filtered or unexported fields
}
[BERITH] Structure that holds the information of the staking accounts for election
type Candidates ¶
type Candidates struct {
// contains filtered or unexported fields
}
func NewCandidates ¶
func NewCandidates() *Candidates
func (*Candidates) Add ¶
func (cs *Candidates) Add(c Candidate)
[BERITH] Function to register Staker to elect Block Creator The function to be called later is the BlockCreator function.
func (Candidates) GetSeed ¶
func (cs Candidates) GetSeed(config *params.ChainConfig, number uint64) int64
[BERITH] Function to convert block number to hash and force it to int64 Write the result value as Seed.
type JSONCandidate ¶
type JSONCandidates ¶
type JSONCandidates struct { User []JSONCandidate `json:"user"` Total uint64 `json:"total"` }
func GetCandidates ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
[BERITH] Circular queue structure for binarySearch by random value
type VoteResult ¶
[Berith] Object that stores voting results for election
type VoteResults ¶
type VoteResults map[common.Address]VoteResult
func SelectBlockCreator ¶
func SelectBlockCreator(config *params.ChainConfig, number uint64, hash common.Hash, stks staking.Stakers, state *state.StateDB) VoteResults
[BERITH] Entry function to elect Block Creator Returns the elected Block Creator map.
Click to show internal directories.
Click to hide internal directories.