mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-27 16:55:21 +00:00
2d7f5c4080
* update sidebar order * update event backticks * fix broken links * fix spelling
24 lines
856 B
Markdown
24 lines
856 B
Markdown
<!--
|
|
order: 2
|
|
-->
|
|
|
|
# State
|
|
|
|
## Genesis state
|
|
|
|
`GenesisState` defines the state that must be persisted when the blockchain stops/restarts in order for normal function of the committee module to resume.
|
|
|
|
```go
|
|
// GenesisState is state that must be provided at chain genesis.
|
|
type GenesisState struct {
|
|
NextProposalID uint64 `json:"next_proposal_id" yaml:"next_proposal_id"`
|
|
Committees []Committee `json:"committees" yaml:"committees"`
|
|
Proposals []Proposal `json:"proposals" yaml:"proposals"`
|
|
Votes []Vote `json:"votes" yaml:"votes"`
|
|
}
|
|
```
|
|
|
|
## Store
|
|
|
|
For complete implementation details for how items are stored, see [keys.go](../types/keys.go). The committee module store state consists of committees, proposals, and votes. When a proposal expires or passes, the proposal and associated votes are deleted from state.
|