chainconfig

package
v0.0.0-...-7149754 Latest Latest
Warning

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

Go to latest
Published: May 28, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ConfigDirPath returns the path of configuration directory of Ignite.
	ConfigDirPath = xfilepath.JoinFromHome(xfilepath.Path(".ignite"))

	// ConfigFileNames is a list of recognized names as for Ignite's config file.
	ConfigFileNames = []string{"config.yml", "config.yaml"}
)
View Source
var 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",
	},
}

DefaultConf holds default configuration.

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/wahaha957/cli/blob/develop/docs/configure/index.md")
)

Functions

func CreateConfigDir

func CreateConfigDir() error

CreateConfigDir creates config directory if it is not created yet.

func FaucetHost

func FaucetHost(conf Config) string

FaucetHost returns the faucet host to use

func LocateDefault

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"`
	CoinType string   `yaml:"cointype,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"`
	LDFlags []string `yaml:"ldflags"`
	Proto   Proto    `yaml:"proto"`
}

Build holds build configs.

type Client

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

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

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

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

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