networkinfo

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// retry for 30s and give up then
	ConnectionRetry = 15
)

ConnectionRetry set the number of retry of connection to bootnode in case the initial connection is failed

Functions

This section is empty.

Types

type Service

type Service struct {
	Host       p2p.Host
	Rendezvous nodeconfig.GroupID
	// contains filtered or unexported fields
}

Service is the network info service.

func MustNew

func MustNew(
	h p2p.Host, rendezvous nodeconfig.GroupID, peerChan chan p2p.Peer,
	bootnodes p2p.AddrList, dataStorePath string,
) *Service

MustNew is a panic-on-error version of New.

func New

func New(
	h p2p.Host, rendezvous nodeconfig.GroupID, peerChan chan p2p.Peer,
	bootnodes p2p.AddrList, dataStorePath string,
) (*Service, error)

New returns role conversion service. If dataStorePath is not empty, it points to a persistent database directory to use.

func (*Service) APIs

func (s *Service) APIs() []rpc.API

APIs for the services.

func (*Service) DoService

func (s *Service) DoService()

DoService does network info.

func (*Service) Init

func (s *Service) Init() error

Init initializes role conversion service.

func (*Service) NotifyService

func (s *Service) NotifyService(params map[string]interface{})

NotifyService notify service

func (*Service) Run

func (s *Service) Run()

Run runs network info.

func (*Service) SetMessageChan

func (s *Service) SetMessageChan(messageChan chan *msg_pb.Message)

SetMessageChan sets up message channel to service.

func (*Service) StartService

func (s *Service) StartService()

StartService starts network info service.

func (*Service) StopService

func (s *Service) StopService()

StopService stops network info service.

Jump to

Keyboard shortcuts

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