-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
unknown unknown
committed
Jun 12, 2024
1 parent
18ed52e
commit 3185f5b
Showing
1 changed file
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,44 @@ | ||
# x/accounts | ||
|
||
The x/accounts module provides module and facilities for writing smart cosmos-sdk accounts. | ||
The x/accounts module provides module and facilities for writing smart cosmos-sdk accounts. | ||
|
||
# Genesis | ||
|
||
## Creating accounts on genesis | ||
|
||
In order to create accounts at genesis, the `x/accounts` module allows developers to provide | ||
a list of genesis `MsgInit` messages that will be executed in the `x/accounts` genesis flow. | ||
|
||
This follows the same initialization flow and rules that would happen if the chain is running. | ||
The only concrete difference is that this is happening at the genesis block. | ||
|
||
For example, given the following `genesis.json` file: | ||
|
||
```json | ||
{ | ||
"app_state": { | ||
"accounts": { | ||
"init_account_msgs": [ | ||
{ | ||
"sender": "account_creator_address", | ||
"account_type": "lockup", | ||
"message": { | ||
"@type": "cosmos.accounts.defaults.lockup.MsgInitLockupAccount", | ||
"owner": "some_owner", | ||
"end_time": "..", | ||
"start_time": ".." | ||
}, | ||
"funds": [ | ||
{ | ||
"denom": "stake", | ||
"amount": "1000" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
``` | ||
|
||
The accounts module will run the lockup account initialization message. |