Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FunctionSignatureCmd = &cobra.Command{ Use: "function_signature", Short: "load solid function signature", Hidden: true, RunE: func(cmd *cobra.Command, args []string) (err error) { err = entity.Start(logger.With("lib", "ent"), config) if err != nil { return } err = memo.Start(logger.With("lib", "memo"), config) if err != nil { return } service.ScanSignature(cmd.Context()) return nil }, }
View Source
var MigrateCmd = &cobra.Command{ Use: "migrate", Short: "Automatic Migration", RunE: func(cmd *cobra.Command, args []string) error { err := entity.Start(logger.With("lib", "ent"), config) if err != nil { return err } db, err := entity.Client(cmd.Context()) if err != nil { return err } err = db.Debug().Schema.Create(cmd.Context()) if err != nil { return err } return nil }, }
View Source
var RootCmd = &cobra.Command{ Use: version.Name, PersistentPreRunE: func(cmd *cobra.Command, args []string) (err error) { logger.Debug("program start") if cmd.Name() == VersionCmd.Name() { return nil } config, err = ParseConfig(cmd) if err != nil { return err } if config.LogFormat == cfg.LogFormatJSON { logger = log.NewTMJSONLogger(log.NewSyncWriter(os.Stdout)) } logger, err = cli.ParseLogLevel(config.LogLevel, logger, cfg.DefaultLogLevel) if err != nil { return err } if viper.GetBool(cli.TraceFlag) { logger = log.NewTracingLogger(logger) } logger = logger.With("module", "main") log.SetDefaultLogger(logger) task.SetLogger(logger) task.SetConfig(config) cmd.SetContext( log.WithContext(cmd.Context(), logger), ) return nil }, }
View Source
var ScanCmd = &cobra.Command{ Use: "scan", Short: "scan block", Run: func(cmd *cobra.Command, args []string) { err := entity.Start(logger.With("lib", "ent"), config) if err != nil { return } err = memo.Start(logger.With("lib", "memo"), config) if err != nil { return } moralis.SetConfig(config) if config.IsLocal() { task.BlockScanRun(schedule.CommandContext(cmd)) } task.InitTask() service.ScanBlock() task.InitEvmParse(cmd.Context(), config, logger.With("module", "task")) schedule.Schedule(schedule.CommandContext(cmd)) aimos.TrapSignal(logger, func() { schedule.Shutdown(context.Background()) }) select {} }, }
ScanCmd ...
View Source
var VersionCmd = &cobra.Command{ Use: "version", Short: "Show version info", Run: func(cmd *cobra.Command, args []string) { aimVersion := version.Version if version.GitCommitHash != "" { aimVersion += "+" + version.GitCommitHash } if verbose { values, _ := json.MarshalIndent(struct { Version string `json:"version"` }{ Version: aimVersion, }, "", " ") fmt.Println(string(values)) } else { fmt.Println(aimVersion) } }, }
VersionCmd ...
Functions ¶
func AddFlags ¶
AddFlags exposes some common configuration options on the command-line These are exposed for convenience of commands embedding
func AddNetworkFlag ¶
func NewExecCmd ¶
func NewStartCmd ¶
NewStartCmd returns the command that allows the CLI to start a node.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.