config

package
v0.0.0-...-0fb7b88 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDir

func GetDir() string

GetDir returns the configuration directory for pairmint from the PAIRMINT_CONFIG_DIR environment variable. If the env var is not set to a custom directory, it will default to $HOME/.pairmint.

func InitDir

func InitDir(configDir string) error

InitDir creates the pairmint configuration directory according to the PAIRMINT_CONFIG_DIR environment variable.

Types

type Config

type Config struct {
	// Init defines the section for the initialization parameters.
	Init InitConfig `mapstructure:"init"`

	// FilePV defines the section for the file-based signer's file paths.
	FilePV FilePVConfig `mapstructure:"file_pv"`
}

Config defines the structure of the pairmint.toml file.

func (*Config) Load

func (c *Config) Load() error

Load loads and validates the configuration parameters for the pairmint node.

type FilePVConfig

type FilePVConfig struct {
	// The chain ID the FilePV signs votes/proposals for.
	ChainID string `mapstructure:"chain_id"`

	// KeyFilePath is the absolute path to the priv_validator_key.json file
	// needed to run the file-based signer.
	KeyFilePath string `mapstructure:"key_file_path"`

	// StateFilePath is the absolute path to the priv_validator_state.json
	// file needed to run the file-based signer.
	StateFilePath string `mapstructure:"state_file_path"`
}

FilePVConfig defines file paths for the file-based signer.

type InitConfig

type InitConfig struct {
	// LogLevel defines the log levels for pairmint logs: DEBUG, INFO, WARN, ERR.
	LogLevel string `mapstructure:"log_level"`

	// SetSize determines the fixed size of the pairminter set.
	// The current signer needs to know the set size in order to know which
	// rank to fall back to if it fails.
	SetSize int `mapstructure:"set_size"`

	// Threshold determines the threshold value of consecutive missed block
	// signatures for rank updates.
	Threshold int `mapstructure:"threshold"`

	// Rank determines the pairminters initial rank on startup.
	Rank int `mapstructure:"rank"`

	// ValidatorListenAddr is the TCP socket address the Tendermint validator
	// listens on for an external PrivValidator process. Pairmint dials this
	// address to establish a connection to the validator and receive signing
	// requests.
	ValidatorListenAddr string `mapstructure:"validator_laddr"`

	// ValidatorListenAddrRPC is the TCP socket address the validator's RPC
	// server listens on.
	ValidatorListenAddrRPC string `mapstructure:"validator_laddr_rpc"`
}

InitConfig defines the initialization parameters for a pairmint node.

Jump to

Keyboard shortcuts

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