Documentation ¶
Index ¶
- Variables
- func CurrentHeight() (curHeight int, networkName string, err error)
- func IsPrivate(ip net.IP) bool
- func PubToCons(prefix, pub string) (string, error)
- func SummariesToChart(s []*Summary) ([]byte, error)
- func SummaryToUpdate(s *Summary) []byte
- func WatchUnconfirmed(ctx context.Context, updates chan []byte, client *http.Client, ...)
- type BlockChart
- type ChartUpdate
- type CommisionRates
- type Commission
- type ConsensusPubkey
- type Description
- type Discovered
- type DiscoveredNode
- type GeoCache
- type GeoNode
- type HistValidatorsResp
- type MinNeighbor
- type NetworkStats
- type NoGeoKeyError
- type NodeLocation
- type Pagination
- type Params
- type Peer
- type PeerMap
- type PeerSet
- type Summary
- type Sunburst
- type Top
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CClient *http.Client TClient *http.Client NetworkId string CUrl string TUrl string )
View Source
var IndexHtml []byte
View Source
var MMCache = &GeoCache{ Nodes: make(map[string]*GeoNode), }
View Source
var MissedHtml []byte
View Source
var NetHtml []byte
View Source
var Precision int
View Source
var Prefix = "cosmos"
View Source
var StaticContent embed.FS
View Source
var UnconfirmedCache = []byte(`[]`)
Functions ¶
func CurrentHeight ¶
func SummariesToChart ¶
func SummaryToUpdate ¶
Types ¶
type BlockChart ¶
type BlockChart struct { Blocks []int `json:"blocks"` // block number Time []string `json:"time"` // time as a string Missed []int `json:"missed"` // number of missing validators MissPct []float64 `json:"missing_percent"` // vote power missing (shows actual risk of losing consensus.) Took []float64 `json:"took"` // time since last block in seconds }
BlockChart is just another way of presenting the same data that is easier to use with some charting libraries, where each series is presented as an array
type ChartUpdate ¶
type CommisionRates ¶
type Commission ¶
type Commission struct { CommisionRates CommisionRates `json:"commision_rates"` UpdateTime time.Time `json:"update_time"` }
type ConsensusPubkey ¶
type Description ¶
type Discovered ¶
type Discovered struct { Nodes map[string]*DiscoveredNode // contains filtered or unexported fields }
func NewDiscovered ¶
func NewDiscovered() *Discovered
func (*Discovered) Skip ¶
func (d *Discovered) Skip(s string) bool
func (*Discovered) Trim ¶
func (d *Discovered) Trim()
type DiscoveredNode ¶
type HistValidatorsResp ¶
type MinNeighbor ¶
type MinNeighbor struct { RemoteIp string `json:"remote_ip"` NodeInfo struct { IsOutbound bool `json:"is_outbound"` Moniker string `json:"moniker"` Other struct { // tendermint RPC API we will try to connect and get more peers (future feature) // if not listening on 127.0.0.1 or unix:// RpcAddress string `json:"rpc_address"` } `json:"other"` } `json:"node_info"` }
MinNeighbor is a stripped down response from the API with only a moniker and IP
type NetworkStats ¶
type NetworkStats struct { PeersDiscovered int `json:"peers_discovered"` RpcDiscovered int `json:"rpc_discovered"` CityLabels []string `json:"city_labels"` CityCounts []int `json:"city_counts"` CountryLabels []string `json:"country_labels"` CountryCounts []int `json:"country_counts"` LastUpdated time.Time `json:"last_updated"` Sunburst []Sunburst `json:"sunburst"` Providers []Sunburst `json:"providers"` }
func NetworkSummary ¶
func NetworkSummary(d *Discovered, p PeerMap) NetworkStats
type NoGeoKeyError ¶
type NoGeoKeyError struct{}
func (NoGeoKeyError) Error ¶
func (n NoGeoKeyError) Error() string
type NodeLocation ¶
type Pagination ¶
type PeerSet ¶
type Summary ¶
type Summary struct { BlockNum int `json:"block_num"` Timestamp int64 `json:"timestamp"` DeltaSec float64 `json:"delta_sec,omitempty"` Missed int `json:"missed"` MissingValidators map[string]string `json:"missing"` PresentValidators map[string]string `json:"-"` Proposer string `json:"proposer"` VotePower uint64 `json:"vote_power"` VoteMissing uint64 `json:"vote_missing"` JailedUnbonding map[string]string `json:"jailed_unbonding"` }
type Top ¶
type Top struct { Moniker string `json:"moniker"` Missed int `json:"missed"` MissedPct float32 `json:"missed_pct"` Votes int64 `json:"votes"` }
Top holds info about who missed rounds, and is used for building a polar area chart, where weight increases with votes
type Validator ¶
type Validator struct { OperatorAddress string `json:"operator_address"` ConsensusPubkey ConsensusPubkey `json:"consensus_pubkey"` Valcons string `json:"valcons,omitempty"` // this is not part of the struct provided by Cosmos ValidatorAddress string `json:"validator-address,omitempty"` // this is not part of the struct provided by Cosmos Jailed bool `json:"jailed"` Status string `json:"status"` Tokens uint64 `json:"tokens"` Description Description `json:"description"` UnbondingHeight uint64 `json:"unbonding_height"` UnbondingTime time.Time `json:"unbonding_time"` Commission Commission `json:"commission"` MinSelfDelegation float64 `json:"min_self_delegation"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.