Versions in this module Expand all Collapse all v1 v1.9.8 Jun 28, 2023 Changes in this version + func NoPrecondition(Peer) bool + func TLSConfig(cert tls.Certificate, keyLogWriter io.Writer) *tls.Config + type Config struct + Beacons validators.Set + Clock mockable.Clock + IPSigner *IPSigner + InboundMsgThrottler throttling.InboundMsgThrottler + LastReceived int64 + LastSent int64 + Log logging.Logger + MaxClockDifference time.Duration + MessageCreator message.Creator + Metrics *Metrics + MySubnets set.Set[ids.ID] + Network Network + NetworkID uint32 + PingFrequency time.Duration + PongTimeout time.Duration + ReadBufferSize int + ResourceTracker tracker.ResourceTracker + Router router.InboundHandler + UptimeCalculator uptime.Calculator + VersionCompatibility version.Compatibility + WriteBufferSize int + type GossipTracker interface + AddKnown func(peerID ids.NodeID, knownTxIDs []ids.ID, txIDs []ids.ID) ([]ids.ID, bool) + AddValidator func(validator ValidatorID) bool + GetNodeID func(txID ids.ID) (ids.NodeID, bool) + GetUnknown func(peerID ids.NodeID) ([]ValidatorID, bool) + RemoveValidator func(validatorID ids.NodeID) bool + ResetValidator func(validatorID ids.NodeID) bool + StartTrackingPeer func(peerID ids.NodeID) bool + StopTrackingPeer func(peerID ids.NodeID) bool + Tracked func(peerID ids.NodeID) bool + func NewGossipTracker(registerer prometheus.Registerer, namespace string) (GossipTracker, error) + type GossipTrackerCallback struct + GossipTracker GossipTracker + Log logging.Logger + func (*GossipTrackerCallback) OnValidatorWeightChanged(ids.NodeID, uint64, uint64) + func (g *GossipTrackerCallback) OnValidatorAdded(nodeID ids.NodeID, _ *bls.PublicKey, txID ids.ID, _ uint64) + func (g *GossipTrackerCallback) OnValidatorRemoved(nodeID ids.NodeID, _ uint64) + type IPSigner struct + func NewIPSigner(ip ips.DynamicIPPort, signer crypto.Signer) *IPSigner + func (s *IPSigner) GetSignedIP() (*SignedIP, error) + type Info struct + ID ids.NodeID + IP string + LastReceived time.Time + LastSent time.Time + ObservedSubnetUptimes map[ids.ID]json.Uint32 + ObservedUptime json.Uint32 + PublicIP string + TrackedSubnets []ids.ID + Version string + type MessageMetrics struct + NumFailed prometheus.Counter + NumReceived prometheus.Counter + NumSent prometheus.Counter + ReceivedBytes prometheus.Counter + SavedReceivedBytes metric.Averager + SavedSentBytes metric.Averager + SentBytes prometheus.Counter + func NewMessageMetrics(op message.Op, namespace string, metrics prometheus.Registerer, ...) *MessageMetrics + type MessageQueue interface + Close func() + Pop func() (message.OutboundMessage, bool) + PopNow func() (message.OutboundMessage, bool) + Push func(ctx context.Context, msg message.OutboundMessage) bool + func NewBlockingMessageQueue(onFailed SendFailedCallback, log logging.Logger, bufferSize int) MessageQueue + func NewThrottledMessageQueue(onFailed SendFailedCallback, id ids.NodeID, log logging.Logger, ...) MessageQueue + type Metrics struct + FailedToParse prometheus.Counter + Log logging.Logger + MessageMetrics map[message.Op]*MessageMetrics + func NewMetrics(log logging.Logger, namespace string, registerer prometheus.Registerer) (*Metrics, error) + func (m *Metrics) MultipleSendsFailed(op message.Op, count int) + func (m *Metrics) Received(msg message.InboundMessage, msgLen uint32) + func (m *Metrics) SendFailed(msg message.OutboundMessage) + func (m *Metrics) Sent(msg message.OutboundMessage) + type MockGossipTracker struct + func NewMockGossipTracker(ctrl *gomock.Controller) *MockGossipTracker + func (m *MockGossipTracker) AddKnown(arg0 ids.NodeID, arg1, arg2 []ids.ID) ([]ids.ID, bool) + func (m *MockGossipTracker) AddValidator(arg0 ValidatorID) bool + func (m *MockGossipTracker) EXPECT() *MockGossipTrackerMockRecorder + func (m *MockGossipTracker) GetNodeID(arg0 ids.ID) (ids.NodeID, bool) + func (m *MockGossipTracker) GetUnknown(arg0 ids.NodeID) ([]ValidatorID, bool) + func (m *MockGossipTracker) RemoveValidator(arg0 ids.NodeID) bool + func (m *MockGossipTracker) ResetValidator(arg0 ids.NodeID) bool + func (m *MockGossipTracker) StartTrackingPeer(arg0 ids.NodeID) bool + func (m *MockGossipTracker) StopTrackingPeer(arg0 ids.NodeID) bool + func (m *MockGossipTracker) Tracked(arg0 ids.NodeID) bool + type MockGossipTrackerMockRecorder struct + func (mr *MockGossipTrackerMockRecorder) AddKnown(arg0, arg1, arg2 interface{}) *gomock.Call + func (mr *MockGossipTrackerMockRecorder) AddValidator(arg0 interface{}) *gomock.Call + func (mr *MockGossipTrackerMockRecorder) GetNodeID(arg0 interface{}) *gomock.Call + func (mr *MockGossipTrackerMockRecorder) GetUnknown(arg0 interface{}) *gomock.Call + func (mr *MockGossipTrackerMockRecorder) RemoveValidator(arg0 interface{}) *gomock.Call + func (mr *MockGossipTrackerMockRecorder) ResetValidator(arg0 interface{}) *gomock.Call + func (mr *MockGossipTrackerMockRecorder) StartTrackingPeer(arg0 interface{}) *gomock.Call + func (mr *MockGossipTrackerMockRecorder) StopTrackingPeer(arg0 interface{}) *gomock.Call + func (mr *MockGossipTrackerMockRecorder) Tracked(arg0 interface{}) *gomock.Call + type Network interface + AllowConnection func(peerID ids.NodeID) bool + Connected func(peerID ids.NodeID) + Disconnected func(peerID ids.NodeID) + MarkTracked func(peerID ids.NodeID, ips []*p2p.PeerAck) error + Peers func(peerID ids.NodeID) ([]ips.ClaimedIPPort, error) + Track func(peerID ids.NodeID, ips []*ips.ClaimedIPPort) ([]*p2p.PeerAck, error) + var TestNetwork Network = testNetwork{} + type Peer interface + AwaitClosed func(ctx context.Context) error + AwaitReady func(ctx context.Context) error + Cert func() *x509.Certificate + Closed func() bool + ID func() ids.NodeID + IP func() *SignedIP + Info func() Info + LastReceived func() time.Time + LastSent func() time.Time + ObservedUptime func(subnetID ids.ID) (uint32, bool) + Ready func() bool + Send func(ctx context.Context, msg message.OutboundMessage) bool + StartClose func() + StartSendPeerList func() + TrackedSubnets func() set.Set[ids.ID] + Version func() *version.Application + func Start(config *Config, conn net.Conn, cert *x509.Certificate, id ids.NodeID, ...) Peer + func StartTestPeer(ctx context.Context, ip ips.IPPort, networkID uint32, ...) (Peer, error) + type SendFailedCallback interface + SendFailed func(message.OutboundMessage) + type SendFailedFunc func(message.OutboundMessage) + func (f SendFailedFunc) SendFailed(msg message.OutboundMessage) + type Set interface + Add func(peer Peer) + AllInfo func() []Info + GetByID func(nodeID ids.NodeID) (Peer, bool) + GetByIndex func(index int) (Peer, bool) + Info func(nodeIDs []ids.NodeID) []Info + Len func() int + Remove func(nodeID ids.NodeID) + Sample func(n int, precondition func(Peer) bool) []Peer + func NewSet() Set + type SignedIP struct + Signature []byte + func (ip *SignedIP) Verify(cert *x509.Certificate) error + type UnsignedIP struct + Timestamp uint64 + func (ip *UnsignedIP) Sign(signer crypto.Signer) (*SignedIP, error) + type Upgrader interface + Upgrade func(net.Conn) (ids.NodeID, net.Conn, *x509.Certificate, error) + func NewTLSClientUpgrader(config *tls.Config) Upgrader + func NewTLSServerUpgrader(config *tls.Config) Upgrader + type ValidatorID struct + NodeID ids.NodeID + TxID ids.ID v1.9.8-rc.9 Jun 28, 2023