-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(accounts): add genesis account initialization #20642
Changes from 5 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the trailing space at the end of line 12. ToolsMarkdownlint
|
||
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": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this done manually? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ahh can we add a excerpt that offline generating messages is the way to do this if that is the intended |
||
"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" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
``` | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure the file ends with a single newline character. ToolsMarkdownlint
|
||
The accounts module will run the lockup account initialization message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure there is only one top-level heading in the document to comply with best practices in Markdown formatting.
Tools
Markdownlint