bootnode

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: LGPL-3.0 Imports: 19 Imported by: 0

README

BootNode struct is the core entity that represents a bootstrap node participating in the Intelchain protocol.

New nodes in a p2p network often make their initial connection to the p2p network through a set of nodes known as boot nodes. Information (e.g. addresses) about these boot nodes is e.g. embedded in an application binary or provided as a configuration option.

The boot nodes serve as an entry point, providing a list of other nodes in the network to newcomers. After connecting to the boot nodes, the new node can connect to those other nodes in the network, thereby no longer relying on the boot nodes.

Documentation

Index

Constants

View Source
const (
	// NumTryBroadCast is the number of times trying to broadcast
	NumTryBroadCast = 3
	// MsgChanBuffer is the buffer of consensus message handlers.
	MsgChanBuffer = 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BootNode

type BootNode struct {
	SelfPeer p2p.Peer

	// intelchain configurations
	IntelchainConfig *intelchainConfig.IntelchainConfig
	// node configuration, including group ID, shard ID, etc
	NodeConfig *nodeConfig.ConfigType
	// RPC configurations
	RPCConfig *bootnodeConfigs.RPCServerConfig

	// metrics
	Metrics metrics.Registry
	// contains filtered or unexported fields
}

BootNode represents a protocol-participating node in the network

func New

New creates a new boot node.

func (*BootNode) APIs

func (bootnode *BootNode) APIs(intelchain *itc_boot.BootService) []rpc.API

APIs return the collection of local RPC services. NOTE, some of these services probably need to be moved to somewhere else.

func (*BootNode) GetConfig

func (bootnode *BootNode) GetConfig() rpc_common.Config

func (*BootNode) GetNodeBootTime

func (bootnode *BootNode) GetNodeBootTime() int64

GetNodeBootTime ..

func (*BootNode) GetRPCServerConfig

func (bootnode *BootNode) GetRPCServerConfig() *bootnodeConfigs.RPCServerConfig

func (*BootNode) ListBlockedPeer

func (bootnode *BootNode) ListBlockedPeer() []peer.ID

ListBlockedPeer return list of blocked peers

func (*BootNode) ListConnectedPeers

func (bootnode *BootNode) ListConnectedPeers() []peer.ID

ListConnectedPeers return connected peers

func (*BootNode) ListKnownPeers

func (bootnode *BootNode) ListKnownPeers() peer.IDSlice

ListKnownPeers return known peers

func (*BootNode) ListPeer

func (bootnode *BootNode) ListPeer(topic string) []peer.ID

ListPeer return list of peers for a certain topic

func (*BootNode) ListTopic

func (bootnode *BootNode) ListTopic() []string

ListTopic return list of topics the node subscribed

func (*BootNode) PeerConnectivity

func (bootnode *BootNode) PeerConnectivity() (int, int, int)

PeerConnectivity ..

func (*BootNode) PeerID

func (bootnode *BootNode) PeerID() peer.ID

PeerID returns self Peer ID

func (*BootNode) RegisterService

func (bootnode *BootNode) RegisterService(st service.Type, s service.Service)

RegisterService register a service to the node service manager

func (*BootNode) ServiceManager

func (bootnode *BootNode) ServiceManager() *service.Manager

ServiceManager ...

func (*BootNode) ShutDown

func (bootnode *BootNode) ShutDown()

ShutDown gracefully shut down the node server and dump the in-memory blockchain state into DB.

func (*BootNode) StartRPC

func (bootnode *BootNode) StartRPC() error

StartRPC start RPC service

func (*BootNode) StartServices

func (bootnode *BootNode) StartServices() error

StartServices runs registered services.

func (*BootNode) StopRPC

func (bootnode *BootNode) StopRPC() error

StopRPC stop RPC service

func (*BootNode) StopServices

func (bootnode *BootNode) StopServices() error

StopServices runs registered services.

Jump to

Keyboard shortcuts

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