config

package
v0.0.0-...-f348377 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfigPath = "./config.toml"
)

Functions

func ParseNodeConfigString

func ParseNodeConfigString(Node_configData []byte, App_configData []byte) (*NODEConfig, *NODEAPPConfig, error)

func ReadNodeConfig

func ReadNodeConfig(Node_configPath string, App_configPath string) (*NODEConfig, *NODEAPPConfig, error)

Types

type APIConfig

type APIConfig struct {
	Enable  bool   `toml:"enable"`
	Address string `toml:"address"`
}

type GRPCConfig

type GRPCConfig struct {
	Enable   bool   `toml:"enable"`
	Address  string `toml:"address"`
	Node_rpc string `toml:"node_grpc"`
}

type INDEPConfig

type INDEPConfig struct {
	Telegram_Token                string `toml:"telegram_token"`
	Telegram_Chat_Id              string `toml:"telegram_chat_id"`
	Pypd_Api_Key                  string `toml:"pypd_api_key"`
	Pypd_Service_Key              string `toml:"pypd_service_key"`
	Pypd_Href                     string `toml:"pypd_herf"`
	Height_Increasing_Time_Period string `toml:"height_increasing_time_period"`
	Missing_Block_Trigger         int64  `toml:"missing_block_trigger"`
	Node_Home_Dir                 string `toml:"node_home_dir"`
}

Config defines all necessary configuration parameters.

func ParseString

func ParseString(configData []byte) (*INDEPConfig, error)

ParseString attempts to read and parse config from the given string bytes. An error reading or parsing the config results in a panic.

func Read

func Read(configPath string) (*INDEPConfig, error)

SetupConfig takes the path to a configuration file and returns the properly parsed configuration.

type NODEAPPConfig

type NODEAPPConfig struct {
	MIN_GAS_PRICES string      `toml:"minimum-gas-prices"`
	PRUNING        string      `toml:"pruning"`
	GRPC           *GRPCConfig `toml:"grpc"`
	API            *APIConfig  `toml:"api"`
}

type NODEConfig

type NODEConfig struct {
	NODE_NAME         string         `toml:"moniker"`
	PRIV_VAL_PATH     string         `toml:"priv_validator_key_file"`
	PRIV_STATE_PATH   string         `toml:"priv_validator_state_file"`
	TX_INDEX          *TXINDEXConfig `toml:"tx_index"`
	RPC               *RPCConfig     `toml:"rpc"`
	DOUBLE_SIGN_CHECK int64          `toml:"double_sign_check_height"`
}

type RPCConfig

type RPCConfig struct {
	Address string `toml:"laddr"`
}

type TXINDEXConfig

type TXINDEXConfig struct {
	Indexer string `toml:"indexer"`
}

Jump to

Keyboard shortcuts

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