cmd

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: CC0-1.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const (
	FlagStartHeight     = "start-height"
	FlagWorkerCount     = "workers"
	FlagListenNewBlocks = "listen-new-blocks"
	FlagParseOldBlocks  = "parse-old-blocks"
	FlagLogLevel        = "log-level"
	FlagLogFormat       = "log-format"
	FlagFormat          = "format"
)
View Source
const (
	LogLevelJSON = "json"
	LogLevelText = "text"
)

Variables

View Source
var (
	// Version defines the application version (defined at compile time)
	Version = ""

	// GitCommit defines the application commit hash (defined at compile time)
	Commit = ""
)

Functions

func BuildDefaultExecutor

func BuildDefaultExecutor(
	name string, setupCfg config.SdkConfigSetup, cdcBuilder config.CodecBuilder, dbBuilder db.Builder,
) cli.Executor

BuildDefaultExecutor allows to build an Executor containing a root command that has the provided name and description and the default version and parse sub-commands implementations.

The provided setupCfg method will be used to customize the SDK configuration. If you don't want any customization you can use the config.DefaultSetup variable.

The provided cdcBuilder is used to provide a codec that will later be used to deserialize the transaction messages. Make sure you register all the types you need properly.

The provided dbBuilder is used to provide the database that will be used to save the data. If you don't have any particular need, you can use the Create variable to build a default database instance.

func ParseCmd

func ParseCmd(cdcBuilder config.CodecBuilder, setupCfg config.SdkConfigSetup, buildDb db.Builder) *cobra.Command

ParseCmd returns the command that should be run when we want to start parsing a chain state. The given codec.Codec is used to parse data, while the db.Builder is going to be used to build the database instance used to store the parsed data.

func PrepareMainCmd

func PrepareMainCmd(cmd *cobra.Command) cli.Executor

PrepareMainCmd is meant to prepare the given command binding all the viper flags

func RootCmd

func RootCmd(name string) *cobra.Command

RootCmd allows to build the default root command having the given name

func SetupFlags

func SetupFlags(cmd *cobra.Command) *cobra.Command

SetupFlags setups all the flags for the parse command

func SetupParsing

func SetupParsing(
	args []string, cdcBuilder config.CodecBuilder, setupCfg config.SdkConfigSetup, buildDb db.Builder,
) (*codec.Codec, *client.Proxy, db.Database, []modules.Module, error)

SetupParsing setups all the things that should be later passed to StartParsing in order to parse the chain data properly.

func StartParsing

func StartParsing(cdc *codec.Codec, cp *client.Proxy, db db.Database, modules []modules.Module) error

parseCmdHandler represents the function that should be called when the parse command is executed

func VersionCmd

func VersionCmd() *cobra.Command

VersionCmd returns the command that allows to show the version information

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