BAC-L2-COSMOS-106Cosmos SDK
Anatomy of a Cosmos module
The module as the unit of application logic: keeper, state, messages, queries, lifecycle. The grammar for the rest of the track.
- Level
- L2 — Appchain developer
- Duration
- 4 h
- Track
- Cosmos SDK
- Maintainer
- Cosmos Lead Architect
Learning objectives
- 01Create a module and register it in the application
- 02Distinguish keeper, state and service interface
- 03Read an existing module and find its extension points
Guided lab
Write a minimal registry module and call it from the command-line interface.
Independent lab
Add a governance-mutable parameter to the module and demonstrate its effect.
Security angle
An over-permissive keeper exposes a module's state to others: restrict the capabilities granted.
Assessment
Module registered, callable, covered by unit tests.
