app

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 64 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultNodeHome default home directories for the application daemon
	DefaultNodeHome = func() string {
		return os.ExpandEnv("$HOME/.ddnode")
	}

	// ModuleBasics defines the module BasicManager is in charge of setting up basic,
	// non-dependant module elements, such as codec registration
	// and genesis verification.
	ModuleBasics = module.NewBasicManager(
		auth.AppModuleBasic{},
		genutil.AppModuleBasic{},
		bank.AppModuleBasic{},
		capability.AppModuleBasic{},
		mint.AppModuleBasic{},
		params.AppModuleBasic{},
		ibc.AppModuleBasic{},
		upgrade.AppModuleBasic{},
		transfer.AppModuleBasic{},
		ddchain.AppModuleBasic{},
	)
)

Functions

func MakeEncodingConfig

func MakeEncodingConfig() params.EncodingConfig

MakeEncodingConfig creates an EncodingConfig for testing

func NewAnteHandler

func NewAnteHandler(options AnteHandlerOptions) (sdk.AnteHandler, error)

NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures & account numbers, and deducts fees from the first signer.

Types

type AnteHandlerOptions

type AnteHandlerOptions struct {
	AccountKeeper   ante.AccountKeeper
	BankKeeper      types.BankKeeper
	FeegrantKeeper  ante.FeegrantKeeper
	SignModeHandler authsigning.SignModeHandler
	SigGasConsumer  func(meter sdk.GasMeter, sig signing.SignatureV2, params types.Params) error
	DDChainKeeper   keeper.Keeper
}

AnteHandlerOptions are the options required for constructing a default SDK AnteHandler.

type App

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

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

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

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

	// InitChainer Application update 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,
	) (servertypes.ExportedApp, error)

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

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

type DDChainApp added in v0.2.0

type DDChainApp struct {
	*baseapp.BaseApp

	// keepers
	AccountKeeper    authkeeper.AccountKeeper
	BankKeeper       bankkeeper.Keeper
	CapabilityKeeper *capabilitykeeper.Keeper
	StakingKeeper    stakingkeeper.Keeper
	MintKeeper       mintkeeper.Keeper
	UpgradeKeeper    upgradekeeper.Keeper
	ParamsKeeper     paramskeeper.Keeper
	IBCKeeper        *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
	TransferKeeper   ibctransferkeeper.Keeper

	// make scoped keepers public for test purposes
	ScopedIBCKeeper      capabilitykeeper.ScopedKeeper
	ScopedTransferKeeper capabilitykeeper.ScopedKeeper
	// contains filtered or unexported fields
}

DDChainApp extends an ABCI application

func New

func New(
	appName string, logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool,
	homePath string, invCheckPeriod uint, encodingConfig appparams.EncodingConfig, telemetryEnabled bool, baseAppOptions ...func(*baseapp.BaseApp),
) *DDChainApp

New returns a reference to an initialized ddnode application.

func (*DDChainApp) AppCodec added in v0.2.0

func (app *DDChainApp) AppCodec() codec.Codec

AppCodec returns app codec.

NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.

func (*DDChainApp) BeginBlocker added in v0.2.0

func (app *DDChainApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock

BeginBlocker application updates every begin block

func (*DDChainApp) BlockedAddrs added in v0.2.0

func (app *DDChainApp) BlockedAddrs() map[string]bool

BlockedAddrs returns all the app's module account addresses that are not allowed to receive external tokens.

func (*DDChainApp) EndBlocker added in v0.2.0

func (app *DDChainApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock

EndBlocker application updates every end block

func (*DDChainApp) ExportAppStateAndValidators added in v0.2.0

func (app *DDChainApp) ExportAppStateAndValidators(
	forZeroHeight bool, jailAllowedAddrs []string,
) (servertypes.ExportedApp, error)

ExportAppStateAndValidators exports the state of the application for a genesis file.

func (*DDChainApp) GetKey added in v0.2.0

func (app *DDChainApp) GetKey(storeKey string) *sdk.KVStoreKey

GetKey returns the KVStoreKey for the provided store key.

NOTE: This is solely to be used for testing purposes.

func (*DDChainApp) GetMemKey added in v0.2.0

func (app *DDChainApp) GetMemKey(storeKey string) *sdk.MemoryStoreKey

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*DDChainApp) GetSubspace added in v0.2.0

func (app *DDChainApp) GetSubspace(moduleName string) paramstypes.Subspace

GetSubspace returns a param subspace for a given module name.

NOTE: This is solely to be used for testing purposes.

func (*DDChainApp) GetTKey added in v0.2.0

func (app *DDChainApp) GetTKey(storeKey string) *sdk.TransientStoreKey

GetTKey returns the TransientStoreKey for the provided store key.

NOTE: This is solely to be used for testing purposes.

func (*DDChainApp) InitChainer added in v0.2.0

func (app *DDChainApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain

InitChainer application update at chain initialization

func (*DDChainApp) InterfaceRegistry added in v0.2.0

func (app *DDChainApp) InterfaceRegistry() types.InterfaceRegistry

InterfaceRegistry returns InterfaceRegistry

func (*DDChainApp) LegacyAmino added in v0.2.0

func (app *DDChainApp) LegacyAmino() *codec.LegacyAmino

LegacyAmino returns the app's amino codec.

NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.

func (*DDChainApp) LoadHeight added in v0.2.0

func (app *DDChainApp) LoadHeight(height int64) error

LoadHeight loads a particular height

func (*DDChainApp) ModuleAccountAddrs added in v0.2.0

func (app *DDChainApp) ModuleAccountAddrs() map[string]bool

ModuleAccountAddrs returns all the app's module account addresses.

func (*DDChainApp) Name added in v0.2.0

func (app *DDChainApp) Name() string

Name returns the name of the App

func (*DDChainApp) RegisterAPIRoutes added in v0.2.0

func (app *DDChainApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)

RegisterAPIRoutes registers all application module routes with the provided API server.

func (*DDChainApp) RegisterTendermintService added in v0.2.0

func (app *DDChainApp) RegisterTendermintService(ctx client.Context)

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*DDChainApp) RegisterTxService added in v0.2.0

func (app *DDChainApp) RegisterTxService(ctx client.Context)

RegisterTxService implements the Application.RegisterTxService method.

type GenesisState

type GenesisState map[string]json.RawMessage

The genesis state of the blockchain is represented here as a map of raw json messages key'd by a identifier string. The identifier is used to determine which module genesis information belongs to so it may be appropriately routed during init chain. Within this application default genesis information is retrieved from the ModuleBasicManager which populates json from each BasicModule object provided to it during init.

func NewDefaultGenesisState

func NewDefaultGenesisState() GenesisState

NewDefaultGenesisState generates the default state for the application.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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