cmd

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: GPL-3.0 Imports: 8 Imported by: 3

Documentation

Overview

Package cmd defines the command line flags for the shared utlities.

Index

Constants

This section is empty.

Variables

View Source
var (
	DumpConfigCommand = &cli.Command{
		Action:      dumpConfig,
		Name:        "dumpconfig",
		Usage:       "Show configuration values",
		ArgsUsage:   "",
		Category:    "MISCELLANEOUS COMMANDS",
		Description: `The dumpconfig command shows configuration values.`,
	}

	InitConfigCommand = &cli.Command{
		Action:      initConfig,
		Name:        "init",
		Usage:       "godbledger init [-m] [databaseLocation]",
		ArgsUsage:   "",
		Category:    "MISCELLANEOUS COMMANDS",
		Description: `The init command creates configuration file.`,
		Flags: []cli.Flag{
			&cli.BoolFlag{
				Name:    "mysql",
				Aliases: []string{"m"},
				Usage:   "set the database to use mysql rather than sqlite"},
		},
	}
)
View Source
var (
	// VerbosityFlag defines the logrus configuration.
	VerbosityFlag = &cli.StringFlag{
		Name:  "verbosity",
		Usage: "Logging verbosity (debug, info=default, warn, error, fatal, panic)",
	}
	// DataDirFlag defines a path on disk.
	DataDirFlag = &cli.StringFlag{
		Name:  "datadir",
		Usage: "Data directory for the databases and keystore",
	}
	// ClearDB tells the node to remove any previously stored data at the data directory.
	ClearDB = &cli.BoolFlag{
		Name:  "clear-db",
		Usage: "Clears any previously stored data at the data directory",
	}
	ConfigFileFlag = &cli.StringFlag{
		Name:  "config",
		Usage: "TOML configuration file",
	}
)

Functions

func DefaultDataDir

func DefaultDataDir() string

DefaultDataDir is the default data directory to use for the databases and other persistence requirements.

func InitConfig

func InitConfig(config *LedgerConfig) error

Types

type LedgerConfig

type LedgerConfig struct {
	RPCPort          string // RPCPort defines the port that the server will listen for transactions on
	DataDirectory    string // DataDirectory defines the host systems folder directory holding the database and config files
	LogVerbosity     string // LogVerbosity defines the logging level {debug, info, warn, error, fatal, panic}
	ConfigFile       string // Location of the TOML config file, including directory path
	DatabaseType     string // Type of Database being used
	DatabaseLocation string // Location of the database file, including directory path or connection string
}

func MakeConfig

func MakeConfig(cli *cli.Context) (error, *LedgerConfig)

Jump to

Keyboard shortcuts

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