peergov

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PeerSourceUnknown               = 0
	PeerSourceTopologyLocalRoot     = 1
	PeerSourceTopologyPublicRoot    = 2
	PeerSourceTopologyBootstrapPeer = 3
	PeerSourceP2PLedger             = 4
	PeerSourceP2PGossip             = 5
	PeerSourceInboundConn           = 6
)
View Source
const (
	OutboundConnectionEventType = "peergov.outbound-conn"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OutboundConnectionEvent

type OutboundConnectionEvent struct {
	ConnectionId ouroboros.ConnectionId
}

type Peer

type Peer struct {
	Address        string
	Source         PeerSource
	Connection     *PeerConnection
	Sharable       bool
	ReconnectCount int
	ReconnectDelay time.Duration
}

type PeerConnection added in v0.3.1

type PeerConnection struct {
	Id              ouroboros.ConnectionId
	ProtocolVersion uint
	VersionData     oprotocol.VersionData
	IsClient        bool
}

type PeerGovernor

type PeerGovernor struct {
	// contains filtered or unexported fields
}

func NewPeerGovernor

func NewPeerGovernor(cfg PeerGovernorConfig) *PeerGovernor

func (*PeerGovernor) GetPeers

func (p *PeerGovernor) GetPeers() []Peer

func (*PeerGovernor) LoadTopologyConfig

func (p *PeerGovernor) LoadTopologyConfig(
	topologyConfig *topology.TopologyConfig,
)

func (*PeerGovernor) Start

func (p *PeerGovernor) Start() error

type PeerGovernorConfig

type PeerGovernorConfig struct {
	Logger          *slog.Logger
	EventBus        *event.EventBus
	ConnManager     *connmanager.ConnectionManager
	DisableOutbound bool
}

type PeerSource

type PeerSource uint16

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL