conf

package
v0.18.6 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 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/configure/index.md")

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

	// DefaultConf holds default configuration.
	DefaultConf = Config{
		Host: Host{

			RPC:     "0.0.0.0:26657",
			P2P:     "0.0.0.0:26656",
			Prof:    "0.0.0.0:6060",
			GRPC:    "0.0.0.0:9090",
			GRPCWeb: "0.0.0.0:9091",
			API:     "0.0.0.0:1317",
		},
		Build: Build{
			Proto: Proto{
				Path: "proto",
				ThirdPartyPaths: []string{
					"third_party/proto",
					"proto_vendor",
				},
			},
		},
		Faucet: Faucet{
			Host: "0.0.0.0:4500",
		},
	}
)

Functions

func FaucetHost added in v0.15.0

func FaucetHost(conf Config) string

FaucetHost returns the faucet host to use

func LocateDefault added in v0.15.0

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

LocateDefault locates the default path for the config file, if no file found 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 {
	Main   string `yaml:"main"`
	Binary string `yaml:"binary"`
	Proto  Proto  `yaml:"proto"`
}

Build holds build configs.

type Client added in v0.15.0

type Client struct {
	// Vuex configures code generation for Vuex.
	Vuex Vuex `yaml:"vuex"`

	// Dart configures client code generation for Dart.
	Dart Dart `yaml:"dart"`

	// OpenAPI configures OpenAPI spec generation for API.
	OpenAPI OpenAPI `yaml:"openapi"`
}

Client configures code generation for clients.

type Config

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

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 Dart added in v0.18.0

type Dart struct {
	// Path configures out location for generated Dart code.
	Path string `yaml:"path"`
}

Dart configures client code generation for Dart.

type Faucet

type Faucet struct {
	// 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"`

	// LimitRefreshTime sets the timeframe at the end of which the limit will be refreshed
	RateLimitWindow string `yaml:"rate_limit_window"`

	// Host is the host of the faucet server
	Host string `yaml:"host"`

	// Port number for faucet server to listen at.
	Port int `yaml:"port"`
}

Faucet configuration.

type Host added in v0.15.0

type Host struct {
	RPC     string `yaml:"rpc"`
	P2P     string `yaml:"p2p"`
	Prof    string `yaml:"prof"`
	GRPC    string `yaml:"grpc"`
	GRPCWeb string `yaml:"grpc-web"`
	API     string `yaml:"api"`
}

Host keeps configuration related to started servers.

type Init

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

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

	// 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"`

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

Init overwrites sdk configurations with given values.

type OpenAPI added in v0.16.0

type OpenAPI struct {
	Path string `yaml:"path"`
}

OpenAPI configures OpenAPI spec generation for API.

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 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.

type Vuex added in v0.15.0

type Vuex struct {
	// Path configures out location for generated Vuex code.
	Path string `yaml:"path"`
}

Vuex configures code generation for Vuex.

Jump to

Keyboard shortcuts

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