cmd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MPL-2.0 Imports: 65 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRootCmd

func InitRootCmd[T transaction.Tx](
	rootCmd *cobra.Command,
	logger log.Logger,
	deps CommandDependencies[T],
) (serverv2.ConfigWriter, error)

InitRootCmd adds sub-commands to the root command.

func NewRootCmd

func NewRootCmd[T transaction.Tx](
	args ...string,
) (*cobra.Command, error)

NewRootCmd creates a root command

func NewTestnetCmd

func NewTestnetCmd[T transaction.Tx](mm *runtimev2.MM[T]) *cobra.Command

NewTestnetCmd creates a root testnet command with subcommands to run an in-process testnet or initialize validator configuration files for running a multi-validator testnet in a separate process

func ProvideClientContext

func ProvideClientContext(
	configMap runtime.GlobalConfig,
	appCodec codec.Codec,
	interfaceRegistry codectypes.InterfaceRegistry,
	txConfigOpts tx.ConfigOptions,
	legacyAmino registry.AminoRegistrar,
	addressCodec address.Codec,
	validatorAddressCodec address.ValidatorAddressCodec,
	consensusAddressCodec address.ConsensusAddressCodec,
) client.Context

ProvideClientContext is a depinject Provider function which assembles and returns a client.Context.

func RootCommandPersistentPreRun

func RootCommandPersistentPreRun(clientCtx client.Context) func(*cobra.Command, []string) error

RootCommandPersistentPreRun initializes the root command state

Types

type CommandDependencies

type CommandDependencies[T transaction.Tx] struct {
	GlobalConfig  coreserver.ConfigMap
	TxConfig      client.TxConfig
	ModuleManager *runtimev2.MM[T]
	App           *app.App[T]
	// could generally be more generic with serverv2.ServerComponent[T]
	// however, we want to register extra grpc handlers
	ConsensusServer *cometbft.CometBFTServer[T]
	ClientContext   client.Context
}

CommandDependencies is a struct that contains all the dependencies needed to initialize the root command. an alternative design could fetch these even later from the command context

Jump to

Keyboard shortcuts

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