config

package
v0.0.0-...-cc82147 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfigPath = "config.toml"
	DefaultGasLimit   = sdk.Gas(500000)
	DefaultFees       = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 100000))
)

Functions

func SetAddressPrefixes

func SetAddressPrefixes() *sdk.Config

SetAddressPrefixes sets chain specific bech32 prefixes.

Types

type Config

type Config struct {
	RPC          RPCConfig    `toml:"rpc"`
	GRPC         GRPCConfig   `toml:"grpc"`
	WalletConfig WalletConfig `toml:"wallet"`
	TxConfig     TxConfig     `toml:"tx"`
}

Config defines all necessary configuration parameters.

func NewConfig

func NewConfig(rpcCfg RPCConfig, gRPCCfg GRPCConfig) *Config

NewConfig builds a new Config instance.

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 GRPCConfig

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

GRPCConfig contains configuration of the gRPC endpoint.

type RPCConfig

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

RPCConfig contains configuration of the RPC endpoint.

type TxConfig

type TxConfig struct {
	GasLimit uint64 `yaml:"gas_limit"`
	Fees     string `yaml:"fees"`
}

TxConfig contains configuration for transaction related parameters.

type WalletConfig

type WalletConfig struct {
	Mnemonic string `yaml:"mnemonic"`
	Password string `yaml:"password"`
}

WalletConfig contains wallet configuration that is used to sign transaction.

Jump to

Keyboard shortcuts

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