commands

package
v0.12.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2016 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfigBasename = "config"
	DefaultConfigType     = "toml"
)

Variables

View Source
var DefaultConfigFilename = fmt.Sprintf("%s.%s",
	DefaultConfigBasename,
	DefaultConfigType)
View Source
var ErisDbCmd = &cobra.Command{
	Use:   "eris-db",
	Short: "Eris-DB is the server side of the eris chain.",
	Long: `Eris-DB is the server side of the eris chain.  Eris-DB combines
a modular consensus engine and application manager to run a chain to suit
your needs.

Made with <3 by Eris Industries.

Complete documentation is available at https://monax.io/docs/documentation
` + "\nVERSION:\n " + version.VERSION,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {

		log.SetLevel(log.WarnLevel)
		if do.Verbose {
			log.SetLevel(log.InfoLevel)
		} else if do.Debug {
			log.SetLevel(log.DebugLevel)
		}
	},
	Run: func(cmd *cobra.Command, args []string) { cmd.Help() },
}
View Source
var ServeCmd = &cobra.Command{
	Use:   "serve",
	Short: "Eris-DB serve starts an eris-db node with client API enabled by default.",
	Long: `Eris-DB serve starts an eris-db node with client API enabled by default.
The Eris-DB node is modularly configured for the consensus engine and application
manager.  The client API can be disabled.`,
	Example: fmt.Sprintf(`$ eris-db serve -- will start the Eris-DB node based on the configuration file "%s" in the current working directory
$ eris-db serve --work-dir <path-to-working-directory> -- will start the Eris-DB node based on the configuration file "%s" in the provided working directory
$ eris-db serve --chain-id <CHAIN_ID> -- will overrule the configuration entry assert_chain_id`,
		DefaultConfigFilename, DefaultConfigFilename),
	PreRun: func(cmd *cobra.Command, args []string) {

		if do.WorkDir == "" {
			if currentDirectory, err := os.Getwd(); err != nil {
				log.Fatalf("No directory provided and failed to get current working directory: %v", err)
				os.Exit(1)
			} else {
				do.WorkDir = currentDirectory
			}
		}
		if !util.IsDir(do.WorkDir) {
			log.Fatalf("Provided working directory %s is not a directory", do.WorkDir)
		}
	},
	Run: Serve,
}

Functions

func AddCommands

func AddCommands()

func AddGlobalFlags

func AddGlobalFlags()

func Execute

func Execute()

func InitErisDbCli

func InitErisDbCli()

func Serve

func Serve(cmd *cobra.Command, args []string)

serve() prepares the environment and sets up the core for Eris_DB to run. After the setup succeeds, serve() starts the core and halts for core to terminate.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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