commands

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientIdentifier = "cosd"
)
View Source
const (
	ClientTag = "v1.0.8"
)

Variables

View Source
var DbCmd = func() *cobra.Command {
	cmd := &cobra.Command{
		Use: "db",
	}

	initCmd := &cobra.Command{
		Use:   "init",
		Short: "initialize all db",
		Run:   initAllDb,
	}

	cmd.AddCommand(initCmd)
	return cmd
}
View Source
var FastSyncCmd = func() *cobra.Command {
	cmd := &cobra.Command{
		Use:     "fast-sync",
		Short:   "fast sync mainnet data",
		Example: "bp enable [bpname]",
		Run:     syncMainnetData,
	}
	cmd.Flags().StringVarP(&specificName, "specificName", "s", "", "specify data file name")
	cmd.Flags().StringVarP(&cfgName, "name", "n", "", "node name (default is cosd)")
	return cmd
}
View Source
var InitCmd = func() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "init",
		Short: "Initialize configuration files",
		Run:   initConf,
	}
	cmd.Flags().StringVarP(&cfgName, "name", "n", "", "node name (default is cosd)")
	cmd.Flags().StringVarP(&chainName, "chain", "c", "", "chain name [main/test/dev], default is main")
	return cmd
}
View Source
var NodeName string
View Source
var StartCmd = func() *cobra.Command {
	cmd := &cobra.Command{
		Use:       "start",
		Short:     "start cosd node",
		Long:      "start cosd node,if has arg 'replay',will sync the lost block to db",
		ValidArgs: []string{"replay"},
		Run:       startNode,
	}
	cmd.Flags().StringVarP(&cfgName, "name", "n", "", "node name (default is cosd)")
	cmd.Flags().StringArrayVarP(&pluginList, "plugin", "", []string{}, "--plugin=[trxsqlservice, dailystatservice, statelogservice, tokeninfoservice]")
	cmd.Flags().BoolVarP(&optReplayReuseSQL, "reuse-sql", "r", false, "reuse current sql data")
	return cmd
}

Functions

func CheckDiskSpace added in v1.0.3

func CheckDiskSpace(path string, log *logrus.Logger) (all uint64, err error)

func InitCrashFile added in v1.0.3

func InitCrashFile(fName string) error

func RegisterService added in v1.0.2

func RegisterService(app *node.Node, cfg node.Config)

Types

This section is empty.

Jump to

Keyboard shortcuts

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