config

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: LGPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultConfigPath = "./config.toml"
View Source
const DefaultKeystorePath = "./keys"

Variables

View Source
var (
	ConfigFileFlag = cli.StringFlag{
		Name:  "config",
		Usage: "TOML configuration file",
	}

	VerbosityFlag = cli.StringFlag{
		Name:  "verbosity",
		Usage: "Supports levels crit (silent) to trce (trace)",
		Value: log.LvlInfo.String(),
	}

	KeystorePathFlag = cli.StringFlag{
		Name:  "keystore",
		Usage: "Path to keystore directory",
		Value: DefaultKeystorePath,
	}

	BlockstorePathFlag = cli.StringFlag{
		Name:  "blockstore",
		Usage: "Specify path for blockstore",
		Value: "",
	}

	FreshStartFlag = cli.BoolFlag{
		Name:  "fresh",
		Usage: "Disables loading from blockstore at start. Opts will still be used if specified.",
	}

	LatestBlockFlag = cli.BoolFlag{
		Name:  "latest",
		Usage: "Overrides blockstore and start block, starts from latest block",
	}
)
View Source
var (
	PasswordFlag = cli.StringFlag{
		Name:  "password",
		Usage: "Password used to encrypt the keystore. Used with --generate, --import, or --unlock",
	}
	Sr25519Flag = cli.BoolFlag{
		Name:  "sr25519",
		Usage: "Specify account/key type as sr25519.",
	}
	Secp256k1Flag = cli.BoolFlag{
		Name:  "secp256k1",
		Usage: "Specify account/key type as secp256k1.",
	}
)

Generate subcommand flags

View Source
var (
	EthereumImportFlag = cli.BoolFlag{
		Name:  "ethereum",
		Usage: "Import an existing ethereum keystore, such as from geth.",
	}
	PrivateKeyFlag = cli.StringFlag{
		Name:  "privateKey",
		Usage: "Import a hex representation of a private key into a keystore.",
	}
)
View Source
var (
	TestKeyFlag = cli.StringFlag{
		Name:  "testkey",
		Usage: "Applies a predetermined test keystore to the chains.",
	}
)

Test Setting Flags

Functions

This section is empty.

Types

type Config

type Config struct {
	Chains       []RawChainConfig `toml:"chains" json:"chains"`
	KeystorePath string           `toml:"keystore_path,omitempty" json:"keystorePath,omitempty"`
}

func GetConfig

func GetConfig(ctx *cli.Context) (*Config, error)

func NewConfig

func NewConfig() *Config

func (*Config) ToJSON

func (c *Config) ToJSON(file string) *os.File

func (*Config) ToTOML

func (c *Config) ToTOML(file string) *os.File

ToTOML writes config to file Deprecated: Limitations of the parsing library makes JSON a better format to support

type RawChainConfig

type RawChainConfig struct {
	Name     string            `toml:"name" json:"name"`
	Type     string            `toml:"type" json:"type"`
	Id       string            `toml:"id" json:"id"`             // ChainID
	Endpoint string            `toml:"endpoint" json:"endpoint"` // url for rpc endpoint
	From     string            `toml:"from" json:"from"`         // address of key to use
	Opts     map[string]string `toml:"opts" json:"opts"`
}

RawChainConfig is parsed directly from the config file and should be using to construct the core.ChainConfig

Jump to

Keyboard shortcuts

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