Documentation
¶
Index ¶
- Constants
- type OutboundConnectionEvent
- type Peer
- type PeerConnection
- type PeerGovernor
- func (p *PeerGovernor) AddPeer(address string, source PeerSource)
- func (p *PeerGovernor) GetPeers() []Peer
- func (p *PeerGovernor) LoadTopologyConfig(topologyConfig *topology.TopologyConfig)
- func (p *PeerGovernor) SetPeerHotByConnId(connId ouroboros.ConnectionId)
- func (p *PeerGovernor) Start() error
- func (p *PeerGovernor) Stop()
- type PeerGovernorConfig
- type PeerSource
- type PeerState
- type PeerStateChangeEvent
Constants ¶
View Source
const ( OutboundConnectionEventType = "peergov.outbound-conn" PeerDemotedEventType = "peergov.peer-demoted" PeerPromotedEventType = "peergov.peer-promoted" PeerRemovedEventType = "peergov.peer-removed" PeerAddedEventType = "peergov.peer-added" )
View Source
const ( PeerSourceUnknown = 0 PeerSourceTopologyLocalRoot = 1 PeerSourceTopologyPublicRoot = 2 PeerSourceTopologyBootstrapPeer = 3 PeerSourceP2PLedger = 4 PeerSourceP2PGossip = 5 PeerSourceInboundConn = 6 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OutboundConnectionEvent ¶
type OutboundConnectionEvent struct {
ConnectionId ouroboros.ConnectionId
}
type Peer ¶
type Peer struct {
LastActivity time.Time
Connection *PeerConnection
Address string
ReconnectCount int
ReconnectDelay time.Duration
Source PeerSource
State PeerState
Sharable bool
}
type PeerConnection ¶ added in v0.3.1
type PeerConnection struct {
Id ouroboros.ConnectionId
VersionData oprotocol.VersionData
ProtocolVersion uint
IsClient bool
}
type PeerGovernor ¶
type PeerGovernor struct {
// contains filtered or unexported fields
}
func NewPeerGovernor ¶
func NewPeerGovernor(cfg PeerGovernorConfig) *PeerGovernor
func (*PeerGovernor) AddPeer ¶ added in v0.18.0
func (p *PeerGovernor) AddPeer(address string, source PeerSource)
func (*PeerGovernor) GetPeers ¶
func (p *PeerGovernor) GetPeers() []Peer
func (*PeerGovernor) LoadTopologyConfig ¶
func (p *PeerGovernor) LoadTopologyConfig( topologyConfig *topology.TopologyConfig, )
func (*PeerGovernor) SetPeerHotByConnId ¶ added in v0.18.0
func (p *PeerGovernor) SetPeerHotByConnId(connId ouroboros.ConnectionId)
func (*PeerGovernor) Start ¶
func (p *PeerGovernor) Start() error
func (*PeerGovernor) Stop ¶ added in v0.18.0
func (p *PeerGovernor) Stop()
Stop gracefully shuts down the peer governor
type PeerGovernorConfig ¶
type PeerGovernorConfig struct {
PromRegistry prometheus.Registerer
Logger *slog.Logger
EventBus *event.EventBus
ConnManager *connmanager.ConnectionManager
PeerRequestFunc func(peer *Peer) []string
ReconcileInterval time.Duration
MaxReconnectFailures int
MinHotPeers int
InactivityTimeout time.Duration
DisableOutbound bool
}
type PeerSource ¶
type PeerSource uint16
type PeerStateChangeEvent ¶ added in v0.18.0
Click to show internal directories.
Click to hide internal directories.