cmd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddConsumerSectionCmd

func AddConsumerSectionCmd(defaultNodeHome string) *cobra.Command

func AddGenesisAccountCmd

func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command

AddGenesisAccountCmd returns add-genesis-account cobra Command.

func SetPrefixes

func SetPrefixes(accountAddressPrefix string)

Types

type App

type App interface {
	servertypes.Application
	ExportableApp
}

App represents a Cosmos SDK application that can be run as a server and with an exportable state

type AppBuilder

type AppBuilder func(
	logger log.Logger,
	db dbm.DB,
	traceStore io.Writer,
	loadLatest bool,
	skipUpgradeHeights map[int64]bool,
	homePath string,
	invCheckPeriod uint,
	encodingConfig EncodingConfig,
	appOpts servertypes.AppOptions,
	baseAppOptions ...func(*baseapp.BaseApp),
) App

AppBuilder is a method that allows to build an app

type CosmosApp

type CosmosApp interface {
	// Name is the assigned name of the app.
	Name() string

	// The application types codec.
	// NOTE: This should be sealed before being returned.
	LegacyAmino() *codec.LegacyAmino

	// BeginBlocker updates every begin block.
	BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock

	// EndBlocker updates every end block.
	EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock

	// InitChainer updates at chain (i.e app) initialization.
	InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain

	// LoadHeight loads the app at a given height.
	LoadHeight(height int64) error

	// ExportAppStateAndValidators exports the state of the application for a genesis file.
	ExportAppStateAndValidators(
		forZeroHeight bool, jailAllowedAddrs []string,
	) (types.ExportedApp, error)

	// ModuleAccountAddrs are registered module account addreses.
	ModuleAccountAddrs() map[string]bool
}

CosmosApp implements the common methods for a Cosmos SDK-based application specific blockchain.

type DefaultGenesisIO

type DefaultGenesisIO struct {
	DefaultGenesisReader
}

func NewDefaultGenesisIO

func NewDefaultGenesisIO() *DefaultGenesisIO

func (DefaultGenesisIO) AlterConsumerModuleState

func (x DefaultGenesisIO) AlterConsumerModuleState(cmd *cobra.Command, callback func(state *GenesisData, appState map[string]json.RawMessage) error) error

type DefaultGenesisReader

type DefaultGenesisReader struct{}

func (DefaultGenesisReader) ReadGenesis

func (d DefaultGenesisReader) ReadGenesis(cmd *cobra.Command) (*GenesisData, error)

type EncodingConfig

type EncodingConfig struct {
	InterfaceRegistry types.InterfaceRegistry
	Marshaler         codec.Codec
	TxConfig          client.TxConfig
	Amino             *codec.LegacyAmino
}

EncodingConfig specifies the concrete encoding types to use for a given app. This is provided for compatibility between protobuf and amino implementations.

func MakeEncodingConfig

func MakeEncodingConfig(moduleBasics module.BasicManager) EncodingConfig

MakeEncodingConfig creates an EncodingConfig for testing

func NewRootCmd

func NewRootCmd(
	appName,
	accountAddressPrefix,
	defaultNodeHome,
	defaultChainID string,
	moduleBasics module.BasicManager,
	buildApp AppBuilder,
	options ...Option,
) (*cobra.Command, EncodingConfig)

NewRootCmd creates a new root command for a Cosmos SDK application

type ExportableApp

type ExportableApp interface {
	ExportAppStateAndValidators(
		forZeroHeight bool,
		jailAllowedAddrs []string,
	) (servertypes.ExportedApp, error)
	LoadHeight(height int64) error
}

ExportableApp represents an app with an exportable state

type GenesisData

type GenesisData struct {
	GenesisFile         string
	GenDoc              *tmtypes.GenesisDoc
	AppState            map[string]json.RawMessage
	ConsumerModuleState *ccvconsumertypes.GenesisState
}

func NewGenesisData

func NewGenesisData(genesisFile string, genDoc *tmtypes.GenesisDoc, appState map[string]json.RawMessage, consumerModuleState *ccvconsumertypes.GenesisState) *GenesisData

type GenesisMutator

type GenesisMutator interface {
	AlterConsumerModuleState(cmd *cobra.Command, callback func(state *GenesisData, appState map[string]json.RawMessage) error) error
}

type Option

type Option func(*rootOptions)

Option configures root command option.

func AddSubCmd

func AddSubCmd(cmd ...*cobra.Command) Option

AddSubCmd adds sub commands.

func CustomizeStartCmd

func CustomizeStartCmd(h func(startCmd *cobra.Command)) Option

CustomizeStartCmd accepts a handler to customize the start command.

func WithEnvPrefix

func WithEnvPrefix(envPrefix string) Option

WithEnvPrefix accepts a new prefix for environment variables.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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