statecmd

package
v0.1.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// StateCmd is the parent command for state-related subcommands
	StateCmd = cobra.Command{
		Use:   "state",
		Short: "State file inspection and management",
		Long: `Inspect and manage the mithril_state.json file.

The state file tracks AccountsDB validity, replay progress, and cluster info.
Use this command to debug issues or share state information.

Examples:
  mithril state                    # Show state summary
  mithril state show               # Same as above
  mithril state --json             # Full JSON dump
  mithril state --full             # Include resume context
  mithril state history            # Show recent events
  mithril state validate           # Validate against AccountsDB`,
		PersistentPreRunE: func(cmd *cobra.Command, args []string) error {

			if accountsFlag != "" {
				return nil
			}
			return config.InitConfig()
		},
		Run: func(cmd *cobra.Command, args []string) {
			runStateShow(cmd)
		},
	}

	// ShowCmd displays state information
	ShowCmd = cobra.Command{
		Use:   "show",
		Short: "Display state file summary",
		Run: func(cmd *cobra.Command, args []string) {
			runStateShow(cmd)
		},
	}

	// HistoryCmd displays state history
	HistoryCmd = cobra.Command{
		Use:   "history",
		Short: "Display state change history",
		Long: `Display the history of state changes (bootstrap, shutdown, corruption events).

Examples:
  mithril state history           # Show last 10 entries
  mithril state history --all     # Show all entries
  mithril state history --json    # Raw JSONL output`,
		Run: func(cmd *cobra.Command, args []string) {
			runStateHistory(cmd)
		},
	}

	// ValidateCmd validates state against AccountsDB
	ValidateCmd = cobra.Command{
		Use:   "validate",
		Short: "Validate state file and AccountsDB artifacts",
		Long: `Validates that the state file and AccountsDB are in a consistent state.

This checks:
- State file exists and is parseable
- Stage is "ready" (not corrupted or building)
- Required AccountsDB artifacts exist on disk

Note: Full bankhash database validation is not yet implemented.`,
		Run: func(cmd *cobra.Command, args []string) {
			runStateValidate(cmd)
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL