Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllAgents = []Agent{ AgentUnknown, AgentLighthouse, AgentNimbus, AgentTeku, AgentPrysm, AgentLodestar, }
AllAgents is a list of all agents.
var PeerDirections = []string{
"inbound",
"outbound",
}
PeerDirections represents all possible peer directions.
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 DepositSnapshot ¶ added in v0.24.0
type DepositSnapshot struct {
Finalized []phase0.Root `json:"finalized"`
DepositRoot phase0.Root `json:"deposit_root"`
DepositCount uint64 `json:"deposit_count"`
ExecutionBlockHash phase0.Root `json:"execution_block_hash"`
ExecutionBlockHeight uint64 `json:"execution_block_height"`
}
DepositSnapshot represents an EIP-4881 deposit snapshot.
func (*DepositSnapshot) MarshalJSON ¶ added in v0.24.0
func (d *DepositSnapshot) MarshalJSON() ([]byte, error)
func (*DepositSnapshot) UnmarshalJSON ¶ added in v0.24.0
func (d *DepositSnapshot) UnmarshalJSON(input []byte) error
type DepositSnapshotJSON ¶ added in v0.24.0
type Identity ¶ added in v0.41.0
type Identity struct {
PeerID string `json:"peer_id"`
ENR string `json:"enr"`
P2PAddresses []string `json:"p2p_addresses"`
DiscoveryAddresses []string `json:"discovery_addresses"`
Metadata struct {
SeqNumber string `json:"seq_number"`
Attnets string `json:"attnets"`
Syncnets string `json:"syncnets"`
} `json:"metadata"`
}
Identity represents the node identity.
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.