conf

package
v0.14.1-0...-8b31b97 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCouldntLocateConfig returned when config.yml cannot be found in the source code.
	ErrCouldntLocateConfig = errors.New("could not locate a config.yml in your chain. please follow the link for how-to: https://github.com/tendermint/starport/blob/develop/docs/1%20Introduction/4%20Configuration.md")

	// FileNames holds a list of appropriate names for the config file.
	FileNames = []string{"config.yml", "config.yaml"}

	// DefaultConf holds default configuration.
	DefaultConf = Config{
		Servers: Servers{
			RPCAddr:      "0.0.0.0:26657",
			P2PAddr:      "0.0.0.0:26656",
			ProfAddr:     "0.0.0.0:6060",
			GRPCAddr:     "0.0.0.0:9090",
			APIAddr:      "0.0.0.0:1317",
			FrontendAddr: "0.0.0.0:8080",
			DevUIAddr:    "0.0.0.0:12345",
		},
		Build: Build{
			Proto: Proto{
				Path: "proto",
				ThirdPartyPaths: []string{
					"third_party/proto",
					"proto_vendor",
				},
			},
		},
		Faucet: Faucet{
			Port: 4500,
		},
	}
)

Functions

func Locate

func Locate(root string) (path string, err error)

Locate locates the path for the config file otherwise returns ErrCouldntLocateConfig.

Types

type Account

type Account struct {
	Name     string   `yaml:"name"`
	Coins    []string `yaml:"coins,omitempty"`
	Mnemonic string   `yaml:"mnemonic,omitempty"`
	Address  string   `yaml:"address,omitempty"`

	// The RPCAddress off the chain that account is issued at.
	RPCAddress string `yaml:"rpc_address,omitempty"`
}

Account holds the options related to setting up Cosmos wallets.

type Build

type Build struct {
	Binary string `yaml:"binary"`
	Proto  Proto  `yaml:"proto"`
}

Build holds build configs.

type Config

type Config struct {
	Accounts  []Account              `yaml:"accounts"`
	Validator Validator              `yaml:"validator"`
	Faucet    Faucet                 `yaml:"faucet"`
	Build     Build                  `yaml:"build"`
	Init      Init                   `yaml:"init"`
	Genesis   map[string]interface{} `yaml:"genesis"`
	Servers   Servers                `yaml:"servers"`
}

Config is the user given configuration to do additional setup during serve.

func Parse

func Parse(r io.Reader) (Config, error)

Parse parses config.yml into UserConfig.

func ParseFile

func ParseFile(path string) (Config, error)

ParseFile parses config.yml from the path.

func (Config) AccountByName

func (c Config) AccountByName(name string) (acc Account, found bool)

AccountByName finds account by name.

type Faucet

type Faucet struct {
	// Port number for faucet server to listen at.
	Port int `yaml:"port"`

	// Name is faucet account's name.
	Name *string `yaml:"name"`

	// Coins holds type of coin denoms and amounts to distribute.
	Coins []string `yaml:"coins"`

	// CoinsMax holds of chain denoms and their max amounts that can be transferred
	// to single user.
	CoinsMax []string `yaml:"coins_max"`
}

Faucet configuration.

type Init

type Init struct {
	// App overwrites appd's config/app.toml configs.
	App map[string]interface{} `yaml:"app"`

	// Config overwrites appd's config/config.toml configs.
	Config map[string]interface{} `yaml:"config"`

	// Home overwrites default home directory used for the app
	Home string `yaml:"home"`

	// CLIHome overwrites default CLI home directory used for launchpad app
	CLIHome string `yaml:"cli-home"`

	// KeyringBackend is the default keyring backend to use for blockchain initialization
	KeyringBackend string `yaml:"keyring-backend"`
}

Init overwrites sdk configurations with given values.

type Proto

type Proto struct {
	// Path is the relative path of where app's proto files are located at.
	Path string `yaml:"path"`

	// ThirdPartyPath is the relative path of where the third party proto files are
	// located that used by the app.
	ThirdPartyPaths []string `yaml:"third_party_paths"`
}

Proto holds proto build configs.

type Servers

type Servers struct {
	RPCAddr      string `yaml:"rpc-address"`
	P2PAddr      string `yaml:"p2p-address"`
	ProfAddr     string `yaml:"prof-address"`
	GRPCAddr     string `yaml:"grpc-address"`
	APIAddr      string `yaml:"api-address"`
	FrontendAddr string `yaml:"frontend-address"`
	DevUIAddr    string `yaml:"dev-ui-address"`
}

Servers keeps configuration related to started servers.

type ValidationError

type ValidationError struct {
	Message string
}

ValidationError is returned when a configuration is invalid.

func (*ValidationError) Error

func (e *ValidationError) Error() string

type Validator

type Validator struct {
	Name   string `yaml:"name"`
	Staked string `yaml:"staked"`
}

Validator holds info related to validator settings.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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