docs: add module migration order guidance (#11255)
* docs: add module migration order guidance * docs: formatting Co-authored-by: Marko <marbar3778@yahoo.com>
This commit is contained in:
parent
75bcf47f13
commit
cf82b663d5
@ -8,7 +8,7 @@ Cosmos SDK modules need to implement the [`AppModule` interfaces](#application-m
|
||||
|
||||
## Pre-requisite Readings
|
||||
|
||||
* [Introduction to Cosmos SDK Modules](./intro.md) {prereq}
|
||||
* [Introduction to Cosmos SDK Modules](./intro.md)
|
||||
|
||||
## Application Module Interfaces
|
||||
|
||||
@ -129,7 +129,9 @@ The `Manager` is a structure that holds all the `AppModule` of an application, a
|
||||
The module manager is used throughout the application whenever an action on a collection of modules is required. It implements the following methods:
|
||||
|
||||
* `NewManager(modules ...AppModule)`: Constructor function. It takes a list of the application's `AppModule`s and builds a new `Manager`. It is generally called from the application's main [constructor function](../basics/app-anatomy.md#constructor-function).
|
||||
* `SetOrderInitGenesis(moduleNames ...string)`: Sets the order in which the [`InitGenesis`](./genesis.md#initgenesis) function of each module will be called when the application is first started. This function is generally called from the application's main [constructor function](../basics/app-anatomy.md#constructor-function).
|
||||
* `SetOrderInitGenesis(moduleNames ...string)`: Sets the order in which the [`InitGenesis`](./genesis.md#initgenesis) function of each module will be called when the application is first started. This function is generally called from the application's main [constructor function](../basics/app-anatomy.md#constructor-function).
|
||||
|
||||
To initialize modules successfully, module dependencies should be considered. For example, the `genutil` module must occur after `staking` module so that the pools are properly initialized with tokens from genesis accounts, the `genutils` module must also occur after `auth` so that it can access the params from auth, `capability` module should be initialized before all other modules so that it can initialize any capabilities.
|
||||
* `SetOrderExportGenesis(moduleNames ...string)`: Sets the order in which the [`ExportGenesis`](./genesis.md#exportgenesis) function of each module will be called in case of an export. This function is generally called from the application's main [constructor function](../basics/app-anatomy.md#constructor-function).
|
||||
* `SetOrderBeginBlockers(moduleNames ...string)`: Sets the order in which the `BeginBlock()` function of each module will be called at the beginning of each block. This function is generally called from the application's main [constructor function](../basics/app-anatomy.md#constructor-function).
|
||||
* `SetOrderEndBlockers(moduleNames ...string)`: Sets the order in which the `EndBlock()` function of each module will be called at the end of each block. This function is generally called from the application's main [constructor function](../basics/app-anatomy.md#constructor-function).
|
||||
|
||||
Loading…
Reference in New Issue
Block a user