Documentation ¶
Index ¶
- Variables
- type Config
- type Info
- type InfoManager
- func (dm *InfoManager) BroadcastNodeInfo(ctx context.Context) error
- func (dm *InfoManager) GetNodeInfo(addr string) (Info, bool)
- func (dm *InfoManager) HandleNodeInfo(ctx context.Context, peerID string, msg *iotextypes.NodeInfo)
- func (dm *InfoManager) HandleNodeInfoRequest(ctx context.Context, peer peer.AddrInfo) error
- func (dm *InfoManager) RequestSingleNodeInfoAsync(ctx context.Context, peer peer.AddrInfo) error
- func (dm *InfoManager) Start(ctx context.Context) error
- func (dm *InfoManager) Stop(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ EnableBroadcastNodeInfo: false, BroadcastNodeInfoInterval: 5 * time.Minute, BroadcastListTTL: 30 * time.Minute, NodeMapSize: 1000, }
DefaultConfig is the default config
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { EnableBroadcastNodeInfo bool `yaml:"enableBroadcastNodeInfo"` BroadcastNodeInfoInterval time.Duration `yaml:"broadcastNodeInfoInterval"` BroadcastListTTL time.Duration `yaml:"broadcastListTTL"` NodeMapSize int `yaml:"nodeMapSize"` }
Config node config
type InfoManager ¶
InfoManager manage delegate node info
func NewInfoManager ¶
func NewInfoManager(cfg *Config, t transmitter, ch chain, privKey crypto.PrivateKey, broadcastListFunc getBroadcastListFunc) *InfoManager
NewInfoManager new info manager
func (*InfoManager) BroadcastNodeInfo ¶
func (dm *InfoManager) BroadcastNodeInfo(ctx context.Context) 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 ¶
HandleNodeInfoRequest tell node info to peer
func (*InfoManager) RequestSingleNodeInfoAsync ¶
RequestSingleNodeInfoAsync unicast request node info message
Click to show internal directories.
Click to hide internal directories.