appmodule

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 5 Imported by: 10

Documentation

Overview

Package appmodule defines what is needed for a module to be used in the Cosmos SDK (runtime). It is equivalent to the appmodulev2 package, but less flexible to stay compatible with baseapp instead of server/v2. If you are looking at integrating dependency injection into your module please see depinject appconfig documentation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppModule

type AppModule = appmodulev2.AppModule

AppModule is a tag interface for app module implementations to use as a basis for extension interfaces. It provides no functionality itself, but is the type that all valid app modules should provide so that they can be identified by other modules (usually via depinject) as app modules.

type Environment

type Environment = appmodulev2.Environment

Environment is used to get all services to their respective module. Contract: All fields of environment are always populated by runtime.

type GenesisSource

type GenesisSource = func(field string) (io.ReadCloser, error)

GenesisSource is a source for genesis data in JSON format. It may abstract over a single JSON object or separate files for each field in a JSON object that can be streamed over. Modules should open a separate io.ReadCloser for each field that is required. When fields represent arrays they can efficiently be streamed over. If there is no data for a field, this function should return nil, nil. It is important that the caller closes the reader when done with it.

type GenesisTarget

type GenesisTarget = func(field string) (io.WriteCloser, error)

GenesisTarget is a target for writing genesis data in JSON format. It may abstract over a single JSON object or JSON in separate files that can be streamed over. Modules should open a separate io.WriteCloser for each field and should prefer writing fields as arrays when possible to support efficient iteration. It is important the caller closers the writer AND checks the error when done with it. It is expected that a stream of JSON data is written to the writer.

type HasABCIGenesis

type HasABCIGenesis = appmodulev2.HasABCIGenesis

HasABCIGenesis defines a custom genesis handling API implementation for ABCI. (stateful genesis methods which returns validator updates) Most modules should not implement this interface.

type HasAminoCodec

type HasAminoCodec interface {
	RegisterLegacyAminoCodec(registry.AminoRegistrar)
}

HasAminoCodec is an extension interface that module must implement to support JSON encoding and decoding of its types through amino. This is used in genesis & the CLI client.

type HasBeginBlocker

type HasBeginBlocker = appmodulev2.HasBeginBlocker

HasBeginBlocker is the extension interface that modules should implement to run custom logic before transaction processing in a block.

type HasConsensusVersion

type HasConsensusVersion = appmodulev2.HasConsensusVersion

HasConsensusVersion is the interface for declaring a module consensus version.

type HasEndBlocker

type HasEndBlocker = appmodulev2.HasEndBlocker

HasEndBlocker is the extension interface that modules should implement to run custom logic after transaction processing in a block.

type HasGenesis

type HasGenesis = appmodulev2.HasGenesis

HasGenesis defines a custom genesis handling API implementation.

type HasGenesisAuto

type HasGenesisAuto interface {
	appmodulev2.AppModule

	// DefaultGenesis writes the default genesis for this module to the target.
	DefaultGenesis(GenesisTarget) error

	// ValidateGenesis validates the genesis data read from the source.
	ValidateGenesis(GenesisSource) error

	// InitGenesis initializes module state from the genesis source.
	InitGenesis(context.Context, GenesisSource) error

	// ExportGenesis exports module state to the genesis target.
	ExportGenesis(context.Context, GenesisTarget) error
}

HasGenesisAuto is the extension interface that modules should implement to handle genesis data and state initialization. WARNING: This interface is experimental and may change at any time and has been dropped in v2.

type HasGenesisBasics

type HasGenesisBasics interface {
	DefaultGenesis() json.RawMessage
	ValidateGenesis(json.RawMessage) error
}

HasGenesisBasics is the legacy interface for stateless genesis methods.

type HasMigrations

type HasMigrations = appmodulev2.HasMigrations

HasMigrations is implemented by a module which upgrades or has upgraded to a new consensus version.

type HasPreBlocker

type HasPreBlocker = appmodulev2.HasPreBlocker

HasPreBlocker is the extension interface that modules should implement to run custom logic before BeginBlock.

type HasPrecommit

type HasPrecommit interface {
	appmodulev2.AppModule
	Precommit(context.Context) error
}

HasPrecommit is an extension interface that contains information about the appmodule.AppModule and Precommit.

type HasPrepareCheckState

type HasPrepareCheckState interface {
	appmodulev2.AppModule
	PrepareCheckState(context.Context) error
}

HasPrepareCheckState is an extension interface that contains information about the AppModule and PrepareCheckState.

type HasRegisterInterfaces

type HasRegisterInterfaces = appmodulev2.HasRegisterInterfaces

HasRegisterInterfaces is the interface for modules to register their msg types.

type MigrationHandler

type MigrationHandler = appmodulev2.MigrationHandler

MigrationHandler is the migration function that each module registers.

type MigrationRegistrar

type MigrationRegistrar = appmodulev2.MigrationRegistrar

MigrationRegistrar is the interface for registering in-place store migrations.

type ValidatorUpdate

type ValidatorUpdate = appmodulev2.ValidatorUpdate

ValidatorUpdate defines a validator update.

type VersionMap

type VersionMap = appmodulev2.VersionMap

VersionMap is a map of moduleName -> version

Directories

Path Synopsis
Package appmodule defines what is needed for a module to be used in the Cosmos SDK (runtime/v2).
Package appmodule defines what is needed for a module to be used in the Cosmos SDK (runtime/v2).

Jump to

Keyboard shortcuts

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