Documentation ¶
Index ¶
- Constants
- func DefaultEth2Monitor(opts ConfigOpts) (*eth2Monitor, error)
- func Init(checkers []CfgChecker) (cfg eth2Config, err error)
- func NewEth2Monitor(r db.Repository, bc net.BeaconAPI, ex net.ExecutionAPI, so net.SubscribeOpts, ...) (*eth2Monitor, error)
- type CfgChecker
- type ConfigOpts
- type EndpointSyncStatus
Constants ¶
const ( Validators = "VALIDATORS" Consensus = "CONSENSUS" Execution = "EXECUTION" )
const ( NoValidatorsFoundError = "no validator address or public index was found. Please check your configuration settings (file, enviroment variables, etc.)" NoConsensusFoundError = "no consensus client endpoint was found. Please check your configuration settings (file, enviroment variables, etc.)" NoExecutionFoundError = "no execution client endpoint was found. Please check your configuration settings (file, enviroment variables, etc.)" ValidatorBalancesError = "something went wrong while fetching validator balances. Skiping current checkpoint. Error: %v" SQLiteCreationError = "sqlite creation failed. Error %v" ParseUintError = "something went wrong while parsing uint. Skiping current validator. Error: %v" ValidatorNotFoundError = "validator not found. Skiping current validator. Error: %v" MigrationError = "failed to migrate database. Error: %v" SetupError = "an error occurred while configurating the monitor. Error: %v" CheckingSyncStatusError = "got error while checking sync status of endpoint %s. Error: %v" InvalidConfigKeyError = "invalid configuration key %s. Valid keys values are %v" )
Variables ¶
This section is empty.
Functions ¶
func DefaultEth2Monitor ¶
func DefaultEth2Monitor(opts ConfigOpts) (*eth2Monitor, error)
DefaultEth2Monitor : Factory for eth2Monitor with recommended settings.
params :- a. opts ConfigOpts Monitor configuration options
returns :- a. *eth2Monitor Monitor middleware intialized with default settings b. error Error if any
func Init ¶
func Init(checkers []CfgChecker) (cfg eth2Config, err error)
Init : Get monitor configuration data from config file or enviroment variables. If a configuration struct is given with data on it, then this data won't be overrided, it will look for missing data.
params :- a. checkers []CfgChecker Configuration data to search for
returns :- a. eth2Config Monitor configuration data b. error Error if any
func NewEth2Monitor ¶
func NewEth2Monitor(r db.Repository, bc net.BeaconAPI, ex net.ExecutionAPI, so net.SubscribeOpts, opts ConfigOpts) (*eth2Monitor, error)
NewEth2Monitor : Factory for eth2Monitor.
params :- a. r db.Repository Interface implementation for data access b. bc networking.BeaconAPI Interface implementation for Beacon chain API interaction c. so networking.SubscribeOpts Configuration options for events subscriber. Should include implementation for Subscriber interface. d. opts ConfigOpts Monitor configuration options
returns :- a. *eth2Monitor Monitor middleware intialized with desired settings
Types ¶
type CfgChecker ¶
type CfgChecker struct { // Configuration key Key string // Error message to throw in case the checks fail ErrMsg string // Configuration data. Should be pre-populated when is not desired to use config file or enviroment variables to get configuration data for 'Key'. Data []string }
CfgChecker : Struct Handle data loading for a given configuration key
type ConfigOpts ¶
type ConfigOpts struct { // True if configuration setup (configuration file setup or enviroment variables setup) should be handled HandleCfg bool // Handle how configuration data should be loaded Checkers []CfgChecker // contains filtered or unexported fields }
ConfigOpts : Struct Represent monitor setup options
type EndpointSyncStatus ¶
EndpointSyncStatus : Struct Represent sync status of an endpoint