Documentation ¶
Index ¶
- type DiscoveryService
- func (d *DiscoveryService) Close()
- func (d *DiscoveryService) ConnectToBootnodes(bootnodes []*peer.AddrInfo)
- func (d *DiscoveryService) FindPeers(ctx context.Context, req *proto.FindPeersReq) (*proto.FindPeersResp, error)
- func (d *DiscoveryService) GetConfirmPeerInfo(peerID peer.ID) *peer.AddrInfo
- func (d *DiscoveryService) GetConfirmPeers() []peer.ID
- func (d *DiscoveryService) HandleNetworkEvent(peerEvent *event.PeerEvent)
- func (d *DiscoveryService) RemovePeerFromRoutingTable(peerID peer.ID)
- func (d *DiscoveryService) RoutingTableSize() int
- func (d *DiscoveryService) Start()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscoveryService ¶
type DiscoveryService struct { proto.UnimplementedDiscoveryServer // contains filtered or unexported fields }
DiscoveryService is a service that finds other peers in the network and connects them to the current running node
func NewDiscoveryService ¶
func NewDiscoveryService( server networkingServer, routingTable *kb.RoutingTable, ignoreCIDR ranger.Ranger, logger hclog.Logger, ) *DiscoveryService
NewDiscoveryService creates a new instance of the discovery service
func (*DiscoveryService) Close ¶
func (d *DiscoveryService) Close()
Close stops the discovery service
func (*DiscoveryService) ConnectToBootnodes ¶
func (d *DiscoveryService) ConnectToBootnodes(bootnodes []*peer.AddrInfo)
ConnectToBootnodes attempts to connect to the bootnodes and add them to the peer / routing table
func (*DiscoveryService) FindPeers ¶
func (d *DiscoveryService) FindPeers( ctx context.Context, req *proto.FindPeersReq, ) (*proto.FindPeersResp, error)
FindPeers implements the proto service for finding the target's peers
func (*DiscoveryService) GetConfirmPeerInfo ¶ added in v1.2.4
func (d *DiscoveryService) GetConfirmPeerInfo(peerID peer.ID) *peer.AddrInfo
GetConfirmPeerInfo fetches the peer information (pass identity check)
func (*DiscoveryService) GetConfirmPeers ¶ added in v1.2.4
func (d *DiscoveryService) GetConfirmPeers() []peer.ID
GetConfirmPeers fetches the peers (pass identity check)
func (*DiscoveryService) HandleNetworkEvent ¶
func (d *DiscoveryService) HandleNetworkEvent(peerEvent *event.PeerEvent)
HandleNetworkEvent handles base network events for the DiscoveryService
func (*DiscoveryService) RemovePeerFromRoutingTable ¶ added in v1.2.4
func (d *DiscoveryService) RemovePeerFromRoutingTable(peerID peer.ID)
func (*DiscoveryService) RoutingTableSize ¶
func (d *DiscoveryService) RoutingTableSize() int
RoutingTableSize returns the size of the routing table
func (*DiscoveryService) Start ¶
func (d *DiscoveryService) Start()
Start starts the discovery service