nodeinfo

package
v2.4.5-rc0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	DisableBroadcastNodeInfo:  false,
	BroadcastNodeInfoInterval: 1 * time.Minute,
	NodeMapSize:               1000,
}

DefaultConfig is the default config

Functions

This section is empty.

Types

type Config

type Config struct {
	DisableBroadcastNodeInfo  bool          `yaml:"enableBroadcastNodeInfo"`
	BroadcastNodeInfoInterval time.Duration `yaml:"broadcastNodeInfoInterval"`
	NodeMapSize               int           `yaml:"nodeMapSize"`
}

Config node config

type Info

type Info struct {
	Version   string
	Height    uint64
	Timestamp time.Time
	Address   string
	PeerID    string
}

Info node infomation

type InfoManager

type InfoManager struct {
	lifecycle.Lifecycle
	// contains filtered or unexported fields
}

InfoManager manage delegate node info

func NewInfoManager

func NewInfoManager(cfg *Config, t transmitter, ch chain, blockInterval time.Duration, privKeys ...crypto.PrivateKey) *InfoManager

NewInfoManager new info manager

func (*InfoManager) BroadcastNodeInfo

func (dm *InfoManager) BroadcastNodeInfo(ctx context.Context, privKeys []crypto.PrivateKey) error

BroadcastNodeInfo broadcast request node info message

func (*InfoManager) GetNodeInfo

func (dm *InfoManager) GetNodeInfo(addr string) (Info, bool)

GetNodeInfo get node info by address

func (*InfoManager) HandleNodeInfo

func (dm *InfoManager) HandleNodeInfo(ctx context.Context, peerID string, msg *iotextypes.NodeInfo)

HandleNodeInfo handle node info message

func (*InfoManager) HandleNodeInfoRequest

func (dm *InfoManager) HandleNodeInfoRequest(ctx context.Context, peer peer.AddrInfo) error

HandleNodeInfoRequest tell node info to peer

func (*InfoManager) MayHaveBlock added in v2.3.3

func (dm *InfoManager) MayHaveBlock(peerID string, start uint64) bool

MayHaveBlock check whether the peer may have the block starting from 'start'

func (*InfoManager) RequestSingleNodeInfoAsync

func (dm *InfoManager) RequestSingleNodeInfoAsync(ctx context.Context, peer peer.AddrInfo) error

RequestSingleNodeInfoAsync unicast request node info message

func (*InfoManager) Start

func (dm *InfoManager) Start(ctx context.Context) error

Start start delegate broadcast task

func (*InfoManager) Stop

func (dm *InfoManager) Stop(ctx context.Context) error

Stop stop delegate broadcast task

func (*InfoManager) UpdateProducerKeys added in v2.3.7

func (dm *InfoManager) UpdateProducerKeys(privKeys []crypto.PrivateKey)

UpdateProducerKeys refreshes the producer key cache used for node-info broadcasts.

Jump to

Keyboard shortcuts

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