Documentation
¶
Index ¶
- Constants
- Variables
- func BuildDefaultExecutor(name string, setupCfg config.SdkConfigSetup, cdcBuilder config.CodecBuilder, ...) cli.Executor
- func ParseCmd(cdcBuilder config.CodecBuilder, setupCfg config.SdkConfigSetup, ...) *cobra.Command
- func PrepareMainCmd(cmd *cobra.Command) cli.Executor
- func RootCmd(name string) *cobra.Command
- func SetupFlags(cmd *cobra.Command) *cobra.Command
- func SetupParsing(args []string, cdcBuilder config.CodecBuilder, setupCfg config.SdkConfigSetup, ...) (*codec.Codec, *client.Proxy, db.Database, []modules.Module, error)
- func StartParsing(cdc *codec.Codec, cp *client.Proxy, db db.Database, modules []modules.Module) error
- func VersionCmd() *cobra.Command
Constants ¶
const ( FlagStartHeight = "start-height" FlagWorkerCount = "workers" FlagListenNewBlocks = "listen-new-blocks" FlagParseOldBlocks = "parse-old-blocks" FlagLogLevel = "log-level" FlagLogFormat = "log-format" FlagFormat = "format" )
const ( LogLevelJSON = "json" LogLevelText = "text" )
Variables ¶
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 ¶
PrepareMainCmd is meant to prepare the given command binding all the viper flags
func SetupFlags ¶
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 ¶
VersionCmd returns the command that allows to show the version information
Types ¶
This section is empty.