config

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRetentionPolicy = "standard"
View Source
const MonitoringDbSchema = "metrics"

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockExplorerConfig added in v0.3.0

type BlockExplorerConfig struct {
	Name        string `` /* 146-byte string literal not displayed */
	REST        string `long:"REST"`
	Environment string `long:"Environment" comment:"one of: mainnet, mirror, devnet1, stagnet1, fairground"`
}

type CoingeckoConfig

type CoingeckoConfig struct {
	ApiURL   string            `long:"ApiURL"`
	ApiKeys  []string          `` /* 128-byte string literal not displayed */
	AssetIds map[string]string `` /* 244-byte string literal not displayed */
}

type CometBFTConfig

type CometBFTConfig struct {
	ApiURL string `long:"ApiURL"`
}

type Config

type Config struct {
	Coingecko CoingeckoConfig `` /* 128-byte string literal not displayed */

	VegaCore VegaCoreConfig `group:"VegaCore" namespace:"vegacore" comment:"used to collect information from the core API"`

	CometBFT CometBFTConfig `` /* 279-byte string literal not displayed */

	Ethereum EthereumConfig `group:"Ethereum" namespace:"ethereum"`

	Arbitrum EthereumConfig `group:"Arbitrum" namespace:"arbitrum"`

	HealthCheck HealthCheckConfig `group:"HealthCheck" namespace:"healthcheck"`

	Logging struct {
		Level string `long:"Level"`
	} `group:"Logging" namespace:"logging"`

	SQLStore SQLStoreConfig `` /* 169-byte string literal not displayed */

	Prometheus PrometheusConfig `group:"Prometheus" namespace:"prometheus"`

	Monitoring MonitoringConfig `group:"Monitoring" namespace:"monitoring" comment:"collected metrics are exposed on prometheus"`

	DataNodeDBExtension DataNodeDBExtensionConfig `` /* 141-byte string literal not displayed */
}

func GetConfigAndLogger

func GetConfigAndLogger(configFilePath string, forceDebug bool) (*Config, *logging.Logger, error)

func NewDefaultConfig

func NewDefaultConfig() Config

func ReadConfigAndWatch

func ReadConfigAndWatch(configFilePath string, logger *logging.Logger) (*Config, error)

func StoreDefaultConfigInFile

func StoreDefaultConfigInFile(filePath string) (*Config, error)

type CoreConfig added in v0.5.0

type CoreConfig struct {
	Name        string `` /* 146-byte string literal not displayed */
	REST        string `long:"REST"`
	Environment string `long:"Environment" comment:"one of: mainnet, mirror, devnet1, stagnet1, fairground"`
}

type DataNodeConfig added in v0.2.0

type DataNodeConfig struct {
	Name        string `` /* 267-byte string literal not displayed */
	REST        string `long:"REST"`
	GraphQL     string `long:"GraphQL"`
	GRPC        string `long:"GRPC"`
	Environment string `long:"Environment" comment:"one of: mainnet, mirror, devnet1, stagnet1, fairground"`
	Internal    bool   `long:"Internal"    comment:"true if node run by Vega Team, otherwise false"`
}

type DataNodeDBExtensionConfig added in v0.3.0

type DataNodeDBExtensionConfig struct {
	Enabled             bool              `` /* 141-byte string literal not displayed */
	BaseRetentionPolicy string            `` /* 323-byte string literal not displayed */
	RetentionPolicy     []RetentionPolicy `long:"RetentionPolicy" comment:"Override policy defined in the BaseRetention Policy"`

	BlockSigners struct {
		Enabled bool `long:"enabled"`
	} `group:"BlockSigners"           namespace:"blocksigners"`
	NetworkHistorySegments struct {
		Enabled bool `long:"enabled"`
	} `group:"NetworkHistorySegments" namespace:"networkhistorysegments"`
	CometTxs struct {
		Enabled bool `long:"enabled"`
	} `group:"CometTxs"               namespace:"comettxs"`
	NetworkBalances struct {
		Enabled bool `long:"enabled"`
	} `group:"NetworkBalances"        namespace:"networkbalances"`
	AssetPrices struct {
		Enabled bool `long:"enabled"`
	} `group:"AssetPrices"            namespace:"assetprices"`
	DataNode struct {
		Enabled bool `long:"enabled"`
	} `group:"DataNode"            namespace:"datanode"`
}

type EthCall added in v0.11.0

type EthCall struct {
	Name            string `long:"Name"    comment:"Unique name to identify the metric in the prometheus metric endpoint"`
	Address         string `long:"Address" comment:"Address of the ethereum contract"`
	Method          string `long:"Method"  comment:"Method name to call"`
	ABI             string `long:"ABI"     comment:"ABI for the call method"`
	Args            []any  `long:"Args"    comment:"List of the arguments passed to the function for the ethereum call"`
	OutputIndex     int    `long:"OutputIndex" comment:"When the contract return multiple output define which one you want to use"`
	OutputTransform string `` /* 257-byte string literal not displayed */
}

type EthEvents added in v0.12.0

type EthEvents struct {
	Name                string `long:"Name"                 comment:"Unique name to identify the metric in the prometheus metric endpoint"`
	ContractAddress     string `long:"ContractAddress"      comment:"Address of the ethereum contract you want to listen events on"`
	ABI                 string `` /* 172-byte string literal not displayed */
	InitialBlocksToScan uint64 `long:"InitialBlocksToScan"  comment:"Number of blocks to scan after vega-monitoring is started"`
	MaxBlocksToFilter   uint64 `long:"MaxBlocksToFilter"    comment:"Number of blocks client may ask for when call FilterLogs"`
}

type EthereumChain added in v0.11.0

type EthereumChain struct {
	NodeName    string        `long:"NodeName"   comment:"Unique human friendly node name"`
	NetworkId   string        `long:"NetworkId"   comment:"Network ID for the specific chain"`
	ChainId     string        `long:"ChainId"     comment:"Chain ID for the specific chain"`
	RPCEndpoint string        `long:"RPCEndpoint" comment:"RPC endpoint for the archival node on the specific chain"`
	Period      time.Duration `long:"Period"     comment:"Period how often We call RPC endpoint"`

	Accounts []string    `group:"Accounts"  namespace:"accounts"  comment:"List of the accounts to check balance for"`
	Calls    []EthCall   `group:"Calls"     namespace:"calls"     comment:"List of the EthCalls we send to the chain and save results"`
	Events   []EthEvents `group:"Events"    namespace:"events"    comment:"Listen events on emitted on the given ethereum smart contract"`
}

type EthereumConfig

type EthereumConfig struct {
	RPCEndpoint      string `long:"RPCEndpoint"      comment:"used to get Asset Pool's asset balances"`
	EtherscanURL     string `long:"EtherscanURL"`
	EtherscanApiKey  string `long:"EtherscanApiKey"`
	AssetPoolAddress string `long:"AssetPoolAddress" comment:"used to get balances of asssets"`
}

type HealthCheckConfig added in v0.10.0

type HealthCheckConfig struct {
	Enabled       bool
	Port          int `long:"port" comment:"the port health-check HTTP server is running on"`
	GrafanaServer struct {
		Enabled bool   `long:"enabled" comment:"if enabled, the health-check expects grafana-server to be running"`
		URI     string `long:"uri" comment:"URI for the grafana e.g: http://127.0.0.1:3000/"`
	} `group:"GrafanaServer" namespace:"grafanaserver"`
}

type LocalNodeConfig added in v0.2.0

type LocalNodeConfig struct {
	Enabled     bool   `long:"Enabled"`
	Name        string `` /* 146-byte string literal not displayed */
	REST        string `long:"REST"`
	Environment string `long:"Environment" comment:"one of: mainnet, mirror, devnet1, stagnet1, fairground"`
	Type        string `long:"Type"        comment:"One of: core, datanode, blockexplorer or leave empty"`
}

type MonitoringConfig added in v0.3.0

type MonitoringConfig struct {
	Core          []CoreConfig          `group:"Core"          namespace:"core"`
	DataNode      []DataNodeConfig      `group:"DataNode"      namespace:"datanode"`
	BlockExplorer []BlockExplorerConfig `group:"BlockExplorer" namespace:"blockexplorer"`
	LocalNode     LocalNodeConfig       `group:"LocalNode"     namespace:"localhode"     comment:"Useful for machine with closed ports"`
	EthereumChain []EthereumChain       `group:"EthereumChain" namespace:"ethereumchain" comment:"Monitor various things on the ethereum chain"`
	Level         string                `long:"Level"`
}

type PrometheusConfig added in v0.2.0

type PrometheusConfig struct {
	Port    int    `long:"port"`
	Path    string `long:"path"`
	Enabled bool   `long:"enabled"`
}

type RetentionPolicy added in v0.9.0

type RetentionPolicy struct {
	TableName string `long:"TableName"`
	Interval  string `long:"Interval"`
}

type SQLStoreConfig

type SQLStoreConfig struct {
	Host     string `long:"host"`
	Port     int    `long:"port"`
	Username string `long:"username"`
	Password string `long:"password"`
	Database string `long:"database"`
}

func (SQLStoreConfig) GetConnectionConfig

func (c SQLStoreConfig) GetConnectionConfig() sqlstore.ConnectionConfig

type VegaCoreConfig added in v0.9.0

type VegaCoreConfig struct {
	ApiURL string `long:"ApiURL"`
}

Jump to

Keyboard shortcuts

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