config

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCoinMarketCapConfig = CoinMarketCapConfig{
	APIKey: "",
}

DefaultCoinMarketCapConfig is the default CoinMarketCap.

View Source
var (
	DefaultConfigPath = "./config.toml"
)
View Source
var DefaultFireStationConfig = FireStationConfig{
	FeeAmount: 100000,
	FeeDenom:  "stake",
}

DefaultFireStationConfig is the default FireStationConfig.

View Source
var DefaultGRPCConfig = GRPCConfig{
	Address: "localhost:9090",
}

DefaultGRPCConfig is the default GRPCConfig.

View Source
var DefaultRPCConfig = RPCConfig{
	Address: "http://localhost:26657",
}

DefaultRPCConfig is the default RPCConfig.

View Source
var DefaultWalletConfig = WalletConfig{
	Mnemonic: "",
}

DefaultWalletConfig is the default WalletConfig.

Functions

This section is empty.

Types

type CoinMarketCapConfig

type CoinMarketCapConfig struct {
	APIKey string `toml:"api_key"`
}

CoinMarketCapConfig contains the API key to request CoinMarketCap's APIs.

type Config

type Config struct {
	RPC           RPCConfig           `toml:"rpc"`
	GRPC          GRPCConfig          `toml:"grpc"`
	Wallet        WalletConfig        `toml:"wallet"`
	CoinMarketCap CoinMarketCapConfig `toml:"coinmarketcap"`
	FireStation   FireStationConfig   `toml:"firestation"`
}

Config defines all necessary configuration parameters.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns default Config object.

func NewConfig

func NewConfig(rpc RPCConfig, gRPC GRPCConfig, coinmarketcap CoinMarketCapConfig) Config

NewConfig builds a new Config object.

func ParseString

func ParseString(configData []byte) (Config, 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) (Config, error)

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

type FireStationConfig

type FireStationConfig struct {
	FeeAmount int64  `toml:"fee_amount"`
	FeeDenom  string `toml:"fee_denom"`
}

FireStationConfig contains two different denoms and CoinMarketCap symbols.

type GRPCConfig

type GRPCConfig struct {
	Address string `toml:"address"`
}

GRPCConfig contains the configuration of the gRPC endpoint.

type RPCConfig

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

RPCConfig contains the configuration of the RPC endpoint.

type WalletConfig

type WalletConfig struct {
	Mnemonic string `toml:"mnemonic"`
}

WalletConfig contains mnemonic which should have sufficient balances to stabilize pool price.

Jump to

Keyboard shortcuts

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