Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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(scdoService *scdo.ScdoService, scdoNode *node.Node, conf *node.Config, slog *log.ScdoLog, 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 scdo 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 ScdoService.
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.