monitor

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: LGPL-3.0 Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBlockchainInfoFailed = errors.New("getting blockchain info failed")
	ErrMinerInfoFailed      = errors.New("getting miner info failed")
	ErrNodeInfoFailed       = errors.New("getting node info failed")
	ErrP2PServerInfoFailed  = errors.New("getting p2p server info failed")
)

error infos

Functions

This section is empty.

Types

type MonitorService

type MonitorService struct {
	// contains filtered or unexported fields
}

MonitorService implements some rpc interfaces provided by a monitor server

func NewMonitorService

func NewMonitorService(seeleService *seele.SeeleService, seeleNode *node.Node, conf *node.Config, slog *log.SeeleLog, name string) (*MonitorService, error)

NewMonitorService returns a MonitorService instance

func (*MonitorService) APIs

func (s *MonitorService) APIs() (apis []rpc.API)

APIs implements node.Service, returning the collection of RPC services the seele package offers.

func (*MonitorService) Protocols

func (s *MonitorService) Protocols() []p2p.Protocol

Protocols implements node.Service, return nil as it dosn't use the p2p service

func (*MonitorService) Start

func (s *MonitorService) Start(srvr *p2p.Server) error

Start implements node.Service, starting goroutines needed by SeeleService.

func (*MonitorService) Stop

func (s *MonitorService) Stop() error

Stop implements node.Service, terminating all internal goroutines.

type NodeInfo

type NodeInfo struct {
	Name       string `json:"name"`
	Node       string `json:"node"`
	Port       int    `json:"port"`
	NetVersion string `json:"netVersion"`
	Protocol   string `json:"protocol"`
	API        string `json:"api"`
	Os         string `json:"os"`
	OsVer      string `json:"os_v"`
	Client     string `json:"client"`
	History    bool   `json:"canUpdateHistory"`
	Shard      uint   `json:"shard"`
}

NodeInfo is the collection of meta information about a node that is displayed on the monitoring page.

type NodeStats

type NodeStats struct {
	Active  bool `json:"active"`
	Syncing bool `json:"syncing"`
	Mining  bool `json:"mining"`
	Peers   int  `json:"peers"`
}

NodeStats is the state information about the local node.

type PublicMonitorAPI

type PublicMonitorAPI struct {
	// contains filtered or unexported fields
}

PublicMonitorAPI provides an API to the monitor service

func NewPublicMonitorAPI

func NewPublicMonitorAPI(s *MonitorService) *PublicMonitorAPI

NewPublicMonitorAPI create new PublicMonitorAPI

func (*PublicMonitorAPI) NodeInfo

func (api *PublicMonitorAPI) NodeInfo() (NodeInfo, error)

NodeInfo returns the NodeInfo struct of the local node

func (*PublicMonitorAPI) NodeStats

func (api *PublicMonitorAPI) NodeStats() (*NodeStats, error)

NodeStats returns the information about the local node.

Jump to

Keyboard shortcuts

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