cosmos/app
Table of Contents
cosmos/app/runtime/v1alpha1/module.proto
TopModule
Module is the config object for the runtime module.
| Field | Type | Label | Description |
| app_name | string | app_name is the name of the app. |
|
| begin_blockers | string | repeated | begin_blockers specifies the module names of begin blockers to call in the order in which they should be called. If this is left empty no begin blocker will be registered. |
| end_blockers | string | repeated | end_blockers specifies the module names of the end blockers to call in the order in which they should be called. If this is left empty no end blocker will be registered. |
| init_genesis | string | repeated | init_genesis specifies the module names of init genesis functions to call in the order in which they should be called. If this is left empty no init genesis function will be registered. |
| export_genesis | string | repeated | export_genesis specifies the order in which to export module genesis data. If this is left empty, the init_genesis order will be used for export genesis if it is specified. |
| override_store_keys | StoreKeyConfig | repeated | override_store_keys is an optional list of overrides for the module store keys to be used in keeper construction. |
| order_migrations | string | repeated | order_migrations defines the order in which module migrations are performed. If this is left empty, it uses the default migration order. https://pkg.go.dev/github.com/cosmos/cosmos-sdk@v0.47.0-alpha2/types/module#DefaultMigrationsOrder |
| precommiters | string | repeated | precommiters specifies the module names of the precommiters to call in the order in which they should be called. If this is left empty no precommit function will be registered. |
| prepare_check_staters | string | repeated | prepare_check_staters specifies the module names of the prepare_check_staters to call in the order in which they should be called. If this is left empty no preparecheckstate function will be registered. |
StoreKeyConfig
StoreKeyConfig may be supplied to override the default module store key, which
is the module name.
| Field | Type | Label | Description |
| module_name | string | name of the module to override the store key of |
|
| kv_store_key | string | the kv store key to use instead of the module name. |
cosmos/app/v1alpha1/config.proto
TopConfig
Config represents the configuration for a Cosmos SDK ABCI app.
It is intended that all state machine logic including the version of
baseapp and tx handlers (and possibly even Tendermint) that an app needs
can be described in a config object. For compatibility, the framework should
allow a mixture of declarative and imperative app wiring, however, apps
that strive for the maximum ease of maintainability should be able to describe
their state machine with a config object alone.
| Field | Type | Label | Description |
| modules | ModuleConfig | repeated | modules are the module configurations for the app. |
| golang_bindings | GolangBinding | repeated | golang_bindings specifies explicit interface to implementation type bindings which depinject uses to resolve interface inputs to provider functions. The scope of this field's configuration is global (not module specific). |
GolangBinding
GolangBinding is an explicit interface type to implementing type binding for dependency injection.
| Field | Type | Label | Description |
| interface_type | string | interface_type is the interface type which will be bound to a specific implementation type |
|
| implementation | string | implementation is the implementing type which will be supplied when an input of type interface is requested |
ModuleConfig
ModuleConfig is a module configuration for an app.
| Field | Type | Label | Description |
| name | string | name is the unique name of the module within the app. It should be a name that persists between different versions of a module so that modules can be smoothly upgraded to new versions. For example, for the module cosmos.bank.module.v1.Module, we may chose to simply name the module "bank" in the app. When we upgrade to cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same and the framework knows that the v2 module should receive all the same state that the v1 module had. Note: modules should provide info on which versions they can migrate from in the ModuleDescriptor.can_migration_from field. |
|
| config | google.protobuf.Any | config is the config object for the module. Module config messages should define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. |
|
| golang_bindings | GolangBinding | repeated | golang_bindings specifies explicit interface to implementation type bindings which depinject uses to resolve interface inputs to provider functions. The scope of this field's configuration is module specific. |
cosmos/app/v1alpha1/module.proto
TopMigrateFromInfo
MigrateFromInfo is information on a module version that a newer module
can migrate from.
| Field | Type | Label | Description |
| module | string | module is the fully-qualified protobuf name of the module config object for the previous module version, ex: "cosmos.group.module.v1.Module". |
ModuleDescriptor
ModuleDescriptor describes an app module.
| Field | Type | Label | Description |
| go_import | string | go_import names the package that should be imported by an app to load the module in the runtime module registry. It is required to make debugging of configuration errors easier for users. |
|
| use_package | PackageReference | repeated | use_package refers to a protobuf package that this module uses and exposes to the world. In an app, only one module should "use" or own a single protobuf package. It is assumed that the module uses all of the .proto files in a single package. |
| can_migrate_from | MigrateFromInfo | repeated | can_migrate_from defines which module versions this module can migrate state from. The framework will check that one module version is able to migrate from a previous module version before attempting to update its config. It is assumed that modules can transitively migrate from earlier versions. For instance if v3 declares it can migrate from v2, and v2 declares it can migrate from v1, the framework knows how to migrate from v1 to v3, assuming all 3 module versions are registered at runtime. |
PackageReference
PackageReference is a reference to a protobuf package used by a module.
| Field | Type | Label | Description |
| name | string | name is the fully-qualified name of the package. |
|
| revision | uint32 | revision is the optional revision of the package that is being used. Protobuf packages used in Cosmos should generally have a major version as the last part of the package name, ex. foo.bar.baz.v1. The revision of a package can be thought of as the minor version of a package which has additional backwards compatible definitions that weren't present in a previous version. A package should indicate its revision with a source code comment above the package declaration in one of its files containing the text "Revision N" where N is an integer revision. All packages start at revision 0 the first time they are released in a module. When a new version of a module is released and items are added to existing .proto files, these definitions should contain comments of the form "Since: Revision N" where N is an integer revision. When the module runtime starts up, it will check the pinned proto image and panic if there are runtime protobuf definitions that are not in the pinned descriptor which do not have a "Since Revision N" comment or have a "Since Revision N" comment where N is <= to the revision specified here. This indicates that the protobuf files have been updated, but the pinned file descriptor hasn't. If there are items in the pinned file descriptor with a revision greater than the value indicated here, this will also cause a panic as it may mean that the pinned descriptor for a legacy module has been improperly updated or that there is some other versioning discrepancy. Runtime protobuf definitions will also be checked for compatibility with pinned file descriptors to make sure there are no incompatible changes. This behavior ensures that: * pinned proto images are up-to-date * protobuf files are carefully annotated with revision comments which are important good client UX * protobuf files are changed in backwards and forwards compatible ways |
File-level Extensions
| Extension | Type | Base | Number | Description |
| module | ModuleDescriptor | .google.protobuf.MessageOptions | 57193479 | module indicates that this proto type is a config object for an app module and optionally provides other descriptive information about the module. It is recommended that a new module config object and go module is versioned for every state machine breaking version of a module. The recommended pattern for doing this is to put module config objects in a separate proto package from the API they expose. Ex: the cosmos.group.v1 API would be exposed by module configs cosmos.group.module.v1, cosmos.group.module.v2, etc. |
cosmos/app/v1alpha1/query.proto
TopQueryConfigRequest
QueryConfigRequest is the Query/Config request type.
QueryConfigResponse
QueryConfigRequest is the Query/Config response type.
| Field | Type | Label | Description |
| config | Config | config is the current app config. |
Query
Query is the app module query service.
| Method Name | Request Type | Response Type | Description |
| Config | QueryConfigRequest | QueryConfigResponse | Config returns the current app config. |
Scalar Value Types
| .proto Type | Notes | Python Type |
| double | float | |
| float | float | |
| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int |
| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int/long |
| uint32 | Uses variable-length encoding. | int/long |
| uint64 | Uses variable-length encoding. | int/long |
| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int |
| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int/long |
| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | int |
| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | int/long |
| sfixed32 | Always four bytes. | int |
| sfixed64 | Always eight bytes. | int/long |
| bool | boolean | |
| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | str/unicode |
| bytes | May contain any arbitrary sequence of bytes. | str |