monitor

package
v0.0.0-...-fcfa923 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccountBal

func GetAccountBal(cfg *config.Config) string

GetAccountBal which resturns the account balance for the command /balance

func GetBlockProduction

func GetBlockProduction(cfg *config.Config) string

GetBlockProduction returns the msg of recent block production details

func GetBlockTime

func GetBlockTime(slot int64, cfg *config.Config) (types.BlockTime, error)

GetBlockTime returns the estimated production time of a confirmed block

func GetClusterNodes

func GetClusterNodes(cfg *config.Config) (types.ClustrNode, error)

GetClusterNodes returns information about all the nodes participating in the cluster

func GetConfirmedBlock

func GetConfirmedBlock(cfg *config.Config, height int64, node string) (types.ConfirmedBlock, error)

GetConfirmedBlock takes current slot height and returns identity and transaction information about a confirmed block in the ledger

func GetConfirmedBlocks

func GetConfirmedBlocks(rangeStart int64, rangeEnd int64, cfg *config.Config) ([]int64, error)

GetConfirmedBlocks returns a list of confirmed blocks between two slots of given range.

func GetCurrentSlot

func GetCurrentSlot(cfg *config.Config, node string) (types.CurrentSlot, error)

GetCurrentSlot returns Current slot

func GetEndPointStatus

func GetEndPointStatus(cfg *config.Config) string

GetEndPointsStatus retsurns status of the configured endpoints i.e, val and network rpc.

func GetEpochDetails

func GetEpochDetails(cfg *config.Config) string

GetEpochDetails returns current epoch of validator and network for /epoch

func GetEpochInfo

func GetEpochInfo(cfg *config.Config, node string) (types.EpochInfo, error)

GetEpochInfo returns information about the current epoch

func GetHelp

func GetHelp() string

GetHelp returns the msg to show for /help

func GetIdentityBalance

func GetIdentityBalance(cfg *config.Config) (types.Balance, error)

GetIdentityBalance returns the balance of the identity account

func GetLeaderSlots

func GetLeaderSlots(epochSlot int64, cfg *config.Config) (map[int64]string, error)

GetLeaderSlots returns a map of slots associated with the given publickey

func GetNodeHealth

func GetNodeHealth(cfg *config.Config) (float64, error)

GetNodeHealth returns the current health of the node.

func GetSkipRate

func GetSkipRate(cfg *config.Config) string

GetSkipRate returns the msg string of skip rate of a validator and network

func GetSlotLeader

func GetSlotLeader(cfg *config.Config) (types.SlotLeader, error)

GetSlotLeader returns the current slot leader

func GetStatus

func GetStatus(cfg *config.Config) string

GetStatus returns the status messages for /status

func GetTxCount

func GetTxCount(cfg *config.Config) (types.TxCount, error)

GetTxCount returns the current Transaction count from the ledger

func GetVersion

func GetVersion(cfg *config.Config) (types.Version, error)

GetVersion returns the current solana versions running on the node

func GetVoteAccBalance

func GetVoteAccBalance(cfg *config.Config) (types.Balance, error)

GetVoteAccBalance returns the balance of the vote account

func GetVoteAccounts

func GetVoteAccounts(cfg *config.Config, node string) (types.GetVoteAccountsResponse, error)

GetVoteAccounts returns voting accounts information

func GetVoteCredits

func GetVoteCredits(cfg *config.Config) string

GetVoteCredits returns credits for /vote_credits

func HitHTTPTarget

func HitHTTPTarget(ops types.HTTPOptions) (*types.PingResp, error)

HitHTTPTarget to hit the target and get response

func NodeStatus

func NodeStatus(cfg *config.Config) string

NodeStatus returns the node health wetaher it is up or down by giving /node

func SendBalanceChangeAlert

func SendBalanceChangeAlert(currentBal int64, cfg *config.Config) error

SendBalanceChangeAlert checks balance and DBbalance, If balance dropped to threshold, sends Alerts to the validator

func SkipRate

func SkipRate(cfg *config.Config) (float64, float64, error)

func SkipRateAlerts

func SkipRateAlerts(cfg *config.Config) error

func Stop

func Stop() string

Stop which will be used to stop the the running program of monitoring tool

func TelegramAlerting

func TelegramAlerting(cfg *config.Config)

TelegramAlerting will check for the commands from the configured telegram account If any commands are given in the tg account then Alerter will send the response back according to the input

Types

type RecentBlock

type RecentBlock struct {
	TotalSlots          int `json:"total_slots"`
	TotalBlocksProduced int `json:"total_blocks_produced"`
	TotalSlotsSkipped   int `json:"total_slots_skipped"`
	LeaderSlots         int `json:"leaderSlots"`
	BlocksProduced      int `json:"blocksProduced"`
	SkippedSlots        int `json:"skippedSlots"`
}

func BlockProduction

func BlockProduction(cfg *config.Config) (RecentBlock, error)

Jump to

Keyboard shortcuts

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