app

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 License: GPL-3.0 Imports: 112 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// NewKeyPasswordPromptText for key creation.
	NewKeyPasswordPromptText = "New key password (at least 8 characters)"
	// PasswordPromptText for wallet unlocking.
	PasswordPromptText = "Key password"
	// ConfirmPasswordPromptText for confirming a key password.
	ConfirmPasswordPromptText = "Confirm password"
)
View Source
const (
	Bech32HRP = "story"
)

Bech32HRP is the human-readable-part of the Bech32 address format.

View Source
const Name = "story"

Variables

View Source
var (
	// `Upgrades` defines the upgrade handlers and store loaders for the application.
	// New upgrades should be added to this slice after they are implemented.
	Upgrades = []upgrades.Upgrade{
		virgil.Upgrade,
		v_1_2_0.Upgrade,
		polybius.Upgrade,
	}
	// Forks are for hard forks that breaks backward compatibility.
	Forks = []upgrades.Fork{
		virgil.Fork,
		v_1_2_0.Fork,
		polybius.Fork,
	}
)
View Source
var PasswordReader = passwordReaderFunc

PasswordReader has passwordReaderFunc as the default but can be changed for testing purposes.

Functions

func DepConfig

func DepConfig() depinject.Config

DepConfig returns the default app depinject config.

func EncryptAndStoreKey added in v1.2.0

func EncryptAndStoreKey(key privval.FilePVKey, password, filePath string) error

func InputPassword added in v1.2.0

func InputPassword(
	promptText, confirmText string,
	shouldConfirmPassword bool,
	passwordValidator func(input string) error,
) (string, error)

InputPassword with a custom validator along capabilities of confirming the password.

func LoadEncryptedPrivKey added in v1.2.0

func LoadEncryptedPrivKey(password, encPrivKeyFile string) (privval.FilePVKey, error)

func PasswordPrompt added in v1.2.0

func PasswordPrompt(promptText string, validateFunc func(string) error) (string, error)

PasswordPrompt prompts the user for a password, that repeatedly requests the password until it qualifies the passed in validation function.

func RollbackCometAndAppState added in v0.14.0

func RollbackCometAndAppState(a *App, cometCfg cmtcfg.Config, rollbackCfg config.RollbackConfig) (lastHeight int64, lastHash []byte, err error)

func Run

func Run(ctx context.Context, cfg Config) error

Run runs the story client until the context is canceled.

func Start

func Start(ctx context.Context, cfg Config) (func(context.Context) error, error)

Start starts the story client returning a stop function or an error.

Note that the original context used to start the app must be canceled first before calling the stop function and a fresh context should be passed into the stop function.

func ValidatePasswordInput added in v1.2.0

func ValidatePasswordInput(input string) error

ValidatePasswordInput validates a strong password input for new accounts, including a min length.

Types

type App

type App struct {
	*runtime.App

	Keepers keepers.Keepers
	// contains filtered or unexported fields
}

App extends an ABCI application, but with most of its parameters exported. They are exported for convenience in creating helper functions, as object capabilities aren't needed for testing.

func CreateApp added in v0.10.2

func CreateApp(ctx context.Context, cfg Config) (*App, *privval.FilePV, error)

func (App) ExportAppStateAndValidators

func (App) ExportAppStateAndValidators(_ bool, _, _ []string) (servertypes.ExportedApp, error)

func (App) GetAccountKeeper

func (a App) GetAccountKeeper() authkeeper.AccountKeeper

func (App) GetBankKeeper

func (a App) GetBankKeeper() bankkeeper.Keeper

func (App) GetDistrKeeper

func (a App) GetDistrKeeper() distrkeeper.Keeper

func (App) GetEvmStakingKeeper added in v0.10.0

func (a App) GetEvmStakingKeeper() *evmstakingkeeper.Keeper

func (App) GetMintKeeper added in v0.12.0

func (a App) GetMintKeeper() mintkeeper.Keeper

func (App) GetSlashingKeeper added in v0.10.0

func (a App) GetSlashingKeeper() slashingkeeper.Keeper

func (App) GetStakingKeeper

func (a App) GetStakingKeeper() *stakingkeeper.Keeper

func (App) GetUpgradeKeeper

func (a App) GetUpgradeKeeper() *upgradekeeper.Keeper

func (App) LegacyAmino

func (App) LegacyAmino() *codec.LegacyAmino

func (*App) PreBlocker

func (a *App) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)

PreBlocker application updates every pre block.

func (App) SetCometAPI

func (a App) SetCometAPI(api comet.API)

SetCometAPI sets the comet API client.

func (App) SimulationManager

func (App) SimulationManager() *module.SimulationManager

type Config

type Config struct {
	storycfg.Config
	Comet cmtcfg.Config
}

Config wraps the story (app) and comet (client) configurations.

func (Config) BackendType

func (c Config) BackendType() dbm.BackendType

BackendType returns the story config backend type or the comet backend type otherwise.

type EncryptedKeyRepresentation added in v1.2.0

type EncryptedKeyRepresentation struct {
	Crypto  map[string]interface{} `json:"crypto"` //nolint:revive // This is from Prysm.
	Version uint                   `json:"version"`
	Name    string                 `json:"name"`
}

EncryptedKeyRepresentation defines an internal representation of encrypted validator key.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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