config

package
v0.0.1-alpha-11 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig(config *Config, path string) error

func GetLoggerFor

func GetLoggerFor(ctx string) *log.Entry

GetLoggerFor returns a logger defined with a context

func InitLogger

func InitLogger(level string)

InitLogger sets the initial configuration of the used logger

Types

type Clients added in v1.4.0

type Clients struct {
	Ethereum   Ethereum   `yaml:"ethereum"`
	MirrorNode MirrorNode `yaml:"mirror_node"`
	Hedera     Hedera     `yaml:"hedera"`
}

type Config

type Config struct {
	Validator Validator `yaml:"validator"`
}

func LoadConfig

func LoadConfig() Config

type Database added in v1.4.0

type Database struct {
	Host     string `yaml:"host" env:"VALIDATOR_DATABASE_HOST"`
	Name     string `yaml:"name" env:"VALIDATOR_DATABASE_NAME"`
	Password string `yaml:"password" env:"VALIDATOR_DATABASE_DB_PASSWORD"`
	Port     string `yaml:"port" env:"VALIDATOR_DATABASE_DB_PORT"`
	Username string `yaml:"username" env:"VALIDATOR_DATABASE_DB_USERNAME"`
}

type Ethereum

type Ethereum struct {
	NodeUrl               string `yaml:"node_url" env:"VALIDATOR_CLIENTS_ETHEREUM_NODE_URL"`
	RouterContractAddress string `yaml:"router_contract_address" env:"VALIDATOR_CLIENTS_ETHEREUM_ROUTER_CONTRACT_ADDRESS"`
	BlockConfirmations    uint64 `yaml:"block_confirmations" env:"VALIDATOR_CLIENTS_ETHEREUM_BLOCK_CONFIRMATIONS"`
	PrivateKey            string `yaml:"private_key" env:"VALIDATOR_CLIENTS_ETHEREUM_PRIVATE_KEY"`
}

type Hedera

type Hedera struct {
	NetworkType   string   `yaml:"network_type" env:"VALIDATOR_CLIENTS_HEDERA_NETWORK_TYPE"`
	Operator      Operator `yaml:"operator"`
	BridgeAccount string   `yaml:"bridge_account" env:"VALIDATOR_CLIENTS_HEDERA_BRIDGE_ACCOUNT"`
	PayerAccount  string   `yaml:"payer_account" env:"VALIDATOR_CLIENTS_HEDERA_PAYER_ACCOUNT"`
	TopicId       string   `yaml:"topic_id" env:"VALIDATOR_CLIENTS_HEDERA_TOPIC_ID"`
	FeePercentage int64    `yaml:"fee_percentage" env:"VALIDATOR_CLIENTS_HEDERA_FEE_PERCENTAGE"`
	Members       []string `yaml:"members" env:"VALIDATOR_CLIENTS_HEDERA_MEMBERS"`
}

type MirrorNode

type MirrorNode struct {
	ClientAddress   string        `yaml:"client_address" env:"VALIDATOR_CLIENTS_MIRROR_NODE_CLIENT_ADDRESS"`
	ApiAddress      string        `yaml:"api_address" env:"VALIDATOR_CLIENTS_MIRROR_NODE_API_ADDRESS"`
	PollingInterval time.Duration `yaml:"polling_interval" env:"VALIDATOR_CLIENTS_MIRROR_NODE_POLLING_INTERVAL"`
}

type Operator

type Operator struct {
	AccountId  string `yaml:"account_id" env:"VALIDATOR_CLIENTS_HEDERA_OPERATOR_ACCOUNT_ID"`
	PrivateKey string `yaml:"private_key" env:"VALIDATOR_CLIENTS_HEDERA_OPERATOR_PRIVATE_KEY"`
}

type Recovery

type Recovery struct {
	StartTimestamp int64 `yaml:"start_timestamp" env:"VALIDATOR_RECOVERY_START_TIMESTAMP"`
}

type Validator

type Validator struct {
	LogLevel    string   `yaml:"log_level" env:"VALIDATOR_LOG_LEVEL"`
	RestApiOnly bool     `yaml:"rest_api_only" env:"VALIDATOR_REST_API_ONLY"`
	Port        string   `yaml:"port" env:"VALIDATOR_PORT"`
	Database    Database `yaml:"database"`
	Clients     Clients  `yaml:"clients"`
	Recovery    Recovery `yaml:"recovery"`
}

Jump to

Keyboard shortcuts

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