cmd

package
v0.0.0-...-7286941 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: Apache-2.0 Imports: 25 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	RPCTimeoutSeconds = 5
)

Variables

This section is empty.

Functions

func Execute

func Execute()

Types

type AlertActive

type AlertActive interface {
	Active(config AlertConfig) bool
}

type AlertConfig

type AlertConfig struct {
	IgnoreAlerts []*AlertType `yaml:"ignore-alerts"`
}

func (*AlertConfig) AlertActive

func (at *AlertConfig) AlertActive(alert AlertType) bool

type AlertLevel

type AlertLevel int8

type AlertType

type AlertType string

func (*AlertType) UnmarshalYAML

func (at *AlertType) UnmarshalYAML(unmarshal func(interface{}) error) error

type BlockFetchError

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

func (*BlockFetchError) Active

func (e *BlockFetchError) Active(config AlertConfig) bool

func (*BlockFetchError) Error

func (e *BlockFetchError) Error() string

type ChainHaltError

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

func (*ChainHaltError) Active

func (e *ChainHaltError) Active(config AlertConfig) bool

func (*ChainHaltError) Error

func (e *ChainHaltError) Error() string

type DiscordChannelConfig

type DiscordChannelConfig struct {
	Webhook      DiscordWebhookConfig `yaml:"webhook"`
	AlertUserIDs []string             `yaml:"alert-user-ids"`
	Username     string               `yaml:"username"`
}

type DiscordNotificationService

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

func NewDiscordNotificationService

func NewDiscordNotificationService(webhookID, webhookToken string) *DiscordNotificationService

func (*DiscordNotificationService) SendValidatorAlertNotification

func (service *DiscordNotificationService) SendValidatorAlertNotification(
	config *NodecordConfig,
	vm *ValidatorMonitor,
	stats ValidatorStats,
	alertNotification *ValidatorAlertNotification,
)

implements NotificationService interface

func (*DiscordNotificationService) UpdateValidatorRealtimeStatus

func (service *DiscordNotificationService) UpdateValidatorRealtimeStatus(
	configFile string,
	config *NodecordConfig,
	vm *ValidatorMonitor,
	stats ValidatorStats,
	writeConfigMutex *sync.Mutex,
)

implements NotificationService interface

type DiscordWebhookConfig

type DiscordWebhookConfig struct {
	ID    string `yaml:"id"`
	Token string `yaml:"token"`
}

type GenericRPCError

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

func (*GenericRPCError) Active

func (e *GenericRPCError) Active(config AlertConfig) bool

func (*GenericRPCError) Error

func (e *GenericRPCError) Error() string

type IgnorableError

type IgnorableError interface {
	error
	AlertActive
}

type JailedError

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

func (*JailedError) Active

func (e *JailedError) Active(config AlertConfig) bool

func (*JailedError) Error

func (e *JailedError) Error() string

type MissedRecentBlocksError

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

func (*MissedRecentBlocksError) Active

func (e *MissedRecentBlocksError) Active(config AlertConfig) bool

func (*MissedRecentBlocksError) Error

func (e *MissedRecentBlocksError) Error() string

type NodecordConfig

type NodecordConfig struct {
	AlertConfig   AlertConfig          `yaml:"alerts"`
	Notifications *NotificationsConfig `yaml:"notifications"`
	Validators    []*ValidatorMonitor  `yaml:"validators"`
}

type NotificationService

type NotificationService interface {
	// send one time alert for validator
	SendValidatorAlertNotification(config *NodecordConfig, vm *ValidatorMonitor, stats ValidatorStats, alertNotification *ValidatorAlertNotification)

	// update (or create) realtime status for validator
	UpdateValidatorRealtimeStatus(configFile string, config *NodecordConfig, vm *ValidatorMonitor, stats ValidatorStats, writeConfigMutex *sync.Mutex)
}

type NotificationsConfig

type NotificationsConfig struct {
	Service string                `yaml:"service"`
	Discord *DiscordChannelConfig `yaml:"discord"`
}

type OutOfSyncError

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

func (*OutOfSyncError) Active

func (e *OutOfSyncError) Active(config AlertConfig) bool

func (*OutOfSyncError) Error

func (e *OutOfSyncError) Error() string

type Sentry

type Sentry struct {
	Name string `yaml:"name"`
	GRPC string `yaml:"grpc"`
}

type SentryAlertType

type SentryAlertType int8

type SentryGRPCError

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

func (*SentryGRPCError) Error

func (e *SentryGRPCError) Error() string

type SentryHaltError

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

func (*SentryHaltError) Error

func (e *SentryHaltError) Error() string

type SentryOutOfSyncError

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

func (*SentryOutOfSyncError) Error

func (e *SentryOutOfSyncError) Error() string

type SentryStats

type SentryStats struct {
	Name            string
	Version         string
	Height          int64
	SentryAlertType SentryAlertType
}

type TombstonedError

type TombstonedError struct{}

func (*TombstonedError) Active

func (e *TombstonedError) Active(config AlertConfig) bool

func (*TombstonedError) Error

func (e *TombstonedError) Error() string

type ValidatorAlertNotification

type ValidatorAlertNotification struct {
	Alerts         []string
	ClearedAlerts  []string
	NotifyForClear bool
	AlertLevel     AlertLevel
}

type ValidatorAlertState

type ValidatorAlertState struct {
	AlertTypeCounts              map[AlertType]int64
	SentryGRPCErrorCounts        map[string]int64
	SentryOutOfSyncErrorCounts   map[string]int64
	SentryHaltErrorCounts        map[string]int64
	SentryLatestHeight           map[string]int64
	RecentMissedBlocksCounter    int64
	RecentMissedBlocksCounterMax int64
	LatestBlockChecked           int64
	LatestBlockSigned            int64
}

type ValidatorMonitor

type ValidatorMonitor struct {
	Name                   string    `yaml:"name"`
	RPC                    string    `yaml:"rpc"`
	Address                string    `yaml:"address"`
	ChainID                string    `yaml:"chain-id"`
	DiscordStatusMessageID *string   `yaml:"discord-status-message-id"`
	RPCRetries             *int      `yaml:"rpc-retries"`
	Sentries               *[]Sentry `yaml:"sentries"`
}

type ValidatorStats

type ValidatorStats struct {
	Timestamp                   time.Time
	Height                      int64
	RecentMissedBlocks          int64
	LastSignedBlockHeight       int64
	RecentMissedBlockAlertLevel AlertLevel
	LastSignedBlockTimestamp    time.Time
	SlashingPeriodUptime        float64
	SentryStats                 []*SentryStats
	AlertLevel                  AlertLevel
	RPCError                    bool
}

Jump to

Keyboard shortcuts

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