targets

package
v0.0.0-...-d1fbd11 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccount

func GetAccount(ops HTTPOptions, cfg *config.Config, c client.Client)

GetAccount returns the account descriptor for the given account.

func GetBlockDetails

func GetBlockDetails(cfg *config.Config, height int64) *consensus.Block

GetBlockDetails returns validator block details

func GetBlockTimeDiff

func GetBlockTimeDiff(ops HTTPOptions, cfg *config.Config, c client.Client)

GetBlockTimeDifference to calculate block time difference of prev block and current block

func GetContinuousMissedBlock

func GetContinuousMissedBlock(cfg *config.Config, c client.Client) string

GetContinuousMissedBlock returns the latest missed block from the db

func GetEmergencyContinuousMissedBlocks

func GetEmergencyContinuousMissedBlocks(cfg *config.Config, c client.Client) string

GetContinuousMissedBlock returns the latest missed block height from the db

func GetMissedBlock

func GetMissedBlock(ops HTTPOptions, cfg *config.Config, c client.Client)

GetMissedBlock checks if the validator is missing any blocks, if so it will send telegram and email alerts to the user about missed blocks

func GetNetworkEpoch

func GetNetworkEpoch(ops HTTPOptions, cfg *config.Config, c client.Client)

GetNetworkEpoch returns the work epoch number of the network

func GetNetworkLatestHeight

func GetNetworkLatestHeight(ops HTTPOptions, cfg *config.Config, c client.Client)

GetNetworkLatestHeight to get the latest height of the network

func GetSelfDelegationBal

func GetSelfDelegationBal(ops HTTPOptions, cfg *config.Config, c client.Client)

GetSelfDelegationBal is to returns the escrow

func GetStatus

func GetStatus(ops HTTPOptions, cfg *config.Config, c client.Client)

GetStatus returns the current status overview and alerts the user based on user configuration

func GetValAlertCount

func GetValAlertCount(cfg *config.Config, c client.Client) string

GetValAlertCount returns count of the val status alert

func GetValEpoch

func GetValEpoch(ops HTTPOptions, cfg *config.Config, c client.Client)

GetValEpoch returns the work epoch number

func GetValidatorBlock

func GetValidatorBlock(cfg *config.Config, c client.Client) string

GetValidatorBlock returns current block height of a validator from db

func GetValidatorEpoch

func GetValidatorEpoch(cfg *config.Config, c client.Client) string

GetValidatorEpoch returns the epoch number of the validator from db

func GetValidatorsList

func GetValidatorsList(ops HTTPOptions, cfg *config.Config, c client.Client)

GetValidatorsList gives the details of your validator

func GetlatestCurrentHeightFromDB

func GetlatestCurrentHeightFromDB(cfg *config.Config, c client.Client) string

GetlatestCurrentHeightFromDB returns latest current height from db

func GetlatestCurrentHeightFromMissedBlocks

func GetlatestCurrentHeightFromMissedBlocks(cfg *config.Config, c client.Client) string

GetlatestCurrentHeightFromDB returns latest current height from db

func NewRunner

func NewRunner() *targetRunner

NewRunner returns targetRunner

func NodeStatus

func NodeStatus(ops HTTPOptions, cfg *config.Config, c client.Client)

NodeStatus returns weather the node is up or not

func NodeVersion

func NodeVersion(ops HTTPOptions, cfg *config.Config, c client.Client)

NodeVersion returns the version of the oasis node

func SendEmailAlert

func SendEmailAlert(msg string, cfg *config.Config) error

SendEmailAlert sends alert to email account by checking user's choice

func SendEmeregencyAlerts

func SendEmeregencyAlerts(cfg *config.Config, c client.Client, cbh string) error

SendEmeregencyAlerts is to send alerts to pager duty if validator miss blocks continously after an alert triggers in pager duty you will be getting calls to your mobile based on the configuration you have done in pagerduty

func SendEmergencyEmailAlert

func SendEmergencyEmailAlert(msg string, cfg *config.Config) error

SendEmergencyEmailAlert sends alert pager duty account

func SendSingleMissedBlockAlert

func SendSingleMissedBlockAlert(cfg *config.Config, c client.Client, blockHeight string) error

SendSingleMissedBlockAlert is to send alert about single missed block alerts

func SendTelegramAlert

func SendTelegramAlert(msg string, cfg *config.Config) error

SendTelegramAlert sends the alert to telegram account by checking user's choice

func ValidatorStatusAlert

func ValidatorStatusAlert(cfg *config.Config, c client.Client, isVoting bool)

ValidatorStatusAlert is to alert about validator status weather it's active or jailed

Types

type HTTPOptions

type HTTPOptions struct {
	Endpoint    string
	QueryParams QueryParams
	Body        []byte
	Method      string
}

HTTPOptions is a structure that holds all http options parameters

type NetworkEpochNumber

type NetworkEpochNumber struct {
	Result int `json:"result"`
}

NetworkEpochNumber which holds the epoch number of the network

type NetworkLatestBlock

type NetworkLatestBlock struct {
	Result struct {
		Height int    `json:"height"`
		Time   string `json:"time"`
		Meta   string `json:"meta"`
	} `json:"result"`
}

NetworkLatestBlock which holds the information about network latest block

type Peer

type Peer struct {
	RemoteIP         string      `json:"remote_ip"`
	ConnectionStatus interface{} `json:"connection_status"`
	IsOutbound       bool        `json:"is_outbound"`
	NodeInfo         struct {
		Moniker string `json:"moniker"`
		Network string `json:"network"`
	} `json:"node_info"`
}

Peer is a structure which holds the info about a peer address

type PingResp

type PingResp struct {
	StatusCode int
	Body       []byte
}

PingResp is a structure which holds the options of a response

func HitHTTPTarget

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

HitHTTPTarget to hit the target and get response

type QueryParams

type QueryParams map[string]string

QueryParams map of strings

type Target

type Target struct {
	ExecutionType string
	HTTPOptions   HTTPOptions
	Name          string
	Func          func(m HTTPOptions, cfg *config.Config, c client.Client)
	ScraperRate   string
}

Target is a structure which holds all the parameters of a target this could be used to write endpoints for each functionality

type Targets

type Targets struct {
	List []Target
}

Targets list of all the targets

func InitTargets

func InitTargets(cfg *config.Config) *Targets

InitTargets which returns the targets can write all the endpoints here

Jump to

Keyboard shortcuts

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