Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AllAgents = []Agent{ AgentUnknown, AgentLighthouse, AgentNimbus, AgentTeku, AgentPrysm, AgentLodestar, }
AllAgents is a list of all agents.
View Source
var PeerDirections = []string{
"inbound",
"outbound",
}
PeerDirections represents all possible peer directions.
View Source
var PeerStates = []string{
"disconnected",
"connected",
"connecting",
"disconnecting",
}
PeerStates represents all possible peer states.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent string
Agent is a peer's agent.
const ( // AgentUnknown is an unknown agent. AgentUnknown Agent = "unknown" // AgentLighthouse is a Lighthouse agent. AgentLighthouse Agent = "lighthouse" // AgentNimbus is a Nimbus agent. AgentNimbus Agent = "nimbus" // AgentTeku is a Teku agent. AgentTeku Agent = "teku" // AgentPrysm is a Prysm agent. AgentPrysm Agent = "prysm" // AgentLodestar is a Lodestar agent. AgentLodestar Agent = "lodestar" )
func AgentFromString ¶
AgentFromString returns the agent from the given string.
type AgentCount ¶
type AgentCount struct { Unknown int `json:"unknown"` Lighthouse int `json:"lighthouse"` Nimbus int `json:"nimbus"` Teku int `json:"teku"` Prysm int `json:"prysm"` Lodestar int `json:"lodestar"` }
AgentCount represents the number of peers with each agent.
type Peer ¶
type Peer struct { PeerID string `json:"peer_id"` ENR string `json:"enr"` LastSeenP2PAddress string `json:"last_seen_p2p_address"` State string `json:"state"` Direction string `json:"direction"` Agent string `json:"agent"` }
Peer represents a peer.
func (*Peer) DeriveAgent ¶
DeriveAgent returns the agent of the peer.
type PeerCount ¶
type PeerCount struct { Disconnected string `json:"disconnected"` Connected string `json:"connected"` Connecting string `json:"connecting"` Disconnecting string `json:"disconnecting"` }
PeerCount represents the number of peers in each state.
type Peers ¶
type Peers []Peer
Peers represents a list of peers.
func (*Peers) AgentCount ¶
func (p *Peers) AgentCount() AgentCount
AgentCount represents the number of peers with each agent.
func (*Peers) ByDirection ¶
ByDirection returns the peers with the given direction.
func (*Peers) ByStateAndDirection ¶
ByStateAndDirection returns the peers with the given state and direction.
Click to show internal directories.
Click to hide internal directories.