Documentation ¶
Index ¶
- Variables
- func CpuRanking(api *fio.API) (map[string]int, error)
- func FindMisses(cpuRank map[string]int, api *fio.API) error
- func RankProducers(eligible []string, cpuRank map[string]int, api *fio.API) ([]string, error)
- func Vote(cpuRank map[string]int, api *fio.API) error
- type BpRank
- type ProducerCompact
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Url string Perm string Actor string Key string Allowed string Address string Frequency int NumVotes int Dry bool V bool Vmux sync.Mutex LastVote string )
View Source
var ( MissedAfter time.Time Missed = make(map[string]time.Time) // holds those who missed blocks, expires at 3*Frequency MissedBlk = 720 // how many blocks since last producing that gets you kicked .... )
tracks missed blocks
Functions ¶
func CpuRanking ¶
CpuRanking penalizes for high numbers, averages over 4k get negative score, increasing by 1 per 1,000µs
func FindMisses ¶
func RankProducers ¶
Types ¶
type BpRank ¶
type BpRank struct { Address fio.Address `json:"address"` Score int `json:"score"` Account eos.AccountName `json:"account"` FeeVote int `json:"fee_vote_30d"` Compute int `json:"compute"` Msig int `json:"msig_30d"` BpClaim int `json:"bpclaim_1d"` TpidClaim int `json:"tpidclaim_1d"` Burn int `json:"burnexpired_1d"` CpuScore int `json:"cpu_score"` // TODO: even more info //Monitor bool `json:"monitor"` //ApiAvail bool `json:"api_avail"` //ApiTls bool `json:"api_tls"` //P2pAvail bool `json:"p2p_avail"` //NetApi bool `json:"net_api"` //ProdApi bool `json:"prod_api"` //MissedBlocks int `json:"missed_blocks"` MissingExcluded bool `json:"missing_excluded"` DiffSignKey bool `json:"diff_sign_key"` BpJson bool `json:"bp_json"` BpJsonCors bool `json:"bp_json_cors"` RegValidUrl bool `json:"valid_url"` UsingLinkedOrMsig bool `json:"using_linked_auth_or_msig"` HasClaimed bool `json:"has_claimed_30d"` Svg string `json:"svg"` Time string `json:"time"` // contains filtered or unexported fields }
type ProducerCompact ¶
type ProducerCompact struct { FioAddress string `json:"fio_address"` TotalVotes string `json:"total_votes"` Url string `json:"url"` LastClaimTime eos.JSONTime `json:"last_claim_time"` LastBpClaim int64 `json:"last_bpclaim"` ProducerPublicKey string `json:"producer_public_key"` }
ProducerCompact trims the response to only what we need.
func GetProducerCompact ¶
func GetProducerCompact(acc eos.AccountName, api *fio.API) (addr string, pc *ProducerCompact, err error)
Click to show internal directories.
Click to hide internal directories.