app

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DefaultKeyPass contains the default key password for genesis transactions
	DefaultKeyPass = "12345678"
)

Variables

View Source
var (
	DefaultCLIHome  = os.ExpandEnv("$HOME/.gaiacli")
	DefaultNodeHome = os.ExpandEnv("$HOME/.gaiad")
)

default home directories for expected binaries

Functions

func CollectStdTxs

func CollectStdTxs(moniker string, genTxsDir string, cdc *codec.Codec) (
	validators []tmtypes.GenesisValidator, appGenTxs []auth.StdTx, persistentPeers string, err error)

CollectStdTxs processes and validates application's genesis StdTxs and returns the list of validators, appGenTxs, and persistent peers required to generate genesis.json.

func GaiaAppGenStateJSON

func GaiaAppGenStateJSON(cdc *codec.Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error)

GaiaAppGenState but with JSON

func GaiaAppInit

func GaiaAppInit() server.AppInit

get app init parameters for server init command

func GaiaValidateGenesisState

func GaiaValidateGenesisState(genesisState GenesisState) (err error)

GaiaValidateGenesisState ensures that the genesis state obeys the expected invariants TODO: No validators are both bonded and jailed (#2088) TODO: Error if there is a duplicate validator (#1708) TODO: Ensure all state machine parameters are in genesis (#1704)

func MakeCodec

func MakeCodec() *codec.Codec

custom tx codec

Types

type GaiaApp

type GaiaApp struct {
	*bam.BaseApp
	// contains filtered or unexported fields
}

Extended ABCI application

func NewGaiaApp

func NewGaiaApp(logger log.Logger, db dbm.DB, traceStore io.Writer, baseAppOptions ...func(*bam.BaseApp)) *GaiaApp

NewGaiaApp returns a reference to an initialized GaiaApp.

func (*GaiaApp) BeginBlocker

func (app *GaiaApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock

application updates every end block

func (*GaiaApp) EndBlocker

func (app *GaiaApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock

application updates every end block nolint: unparam

func (*GaiaApp) ExportAppStateAndValidators

func (app *GaiaApp) ExportAppStateAndValidators() (appState json.RawMessage, validators []tmtypes.GenesisValidator, err error)

export the state of gaia for a genesis file

type GenesisAccount

type GenesisAccount struct {
	Address sdk.AccAddress `json:"address"`
	Coins   sdk.Coins      `json:"coins"`
}

GenesisAccount doesn't need pubkey or sequence

func NewDefaultGenesisAccount

func NewDefaultGenesisAccount(addr sdk.AccAddress) GenesisAccount

func NewGenesisAccount

func NewGenesisAccount(acc *auth.BaseAccount) GenesisAccount

func NewGenesisAccountI

func NewGenesisAccountI(acc sdk.Account) GenesisAccount

func (*GenesisAccount) ToAccount

func (ga *GenesisAccount) ToAccount() (acc *auth.BaseAccount)

convert GenesisAccount to auth.BaseAccount

type GenesisState

type GenesisState struct {
	Accounts     []GenesisAccount      `json:"accounts"`
	StakeData    stake.GenesisState    `json:"stake"`
	MintData     mint.GenesisState     `json:"mint"`
	DistrData    distr.GenesisState    `json:"distr"`
	GovData      gov.GenesisState      `json:"gov"`
	SlashingData slashing.GenesisState `json:"slashing"`
	GenTxs       []json.RawMessage     `json:"gentxs"`
}

State to Unmarshal

func GaiaAppGenState

func GaiaAppGenState(cdc *codec.Codec, appGenTxs []json.RawMessage) (genesisState GenesisState, err error)

Create the core parameters for genesis initialization for gaia note that the pubkey input is this machines pubkey

func NewGenesisState

func NewGenesisState(accounts []GenesisAccount, stakeData stake.GenesisState, mintData mint.GenesisState,
	distrData distr.GenesisState, govData gov.GenesisState, slashingData slashing.GenesisState) GenesisState

type Hooks

type Hooks struct {
	// contains filtered or unexported fields
}

Combined Staking Hooks

func NewHooks

func NewHooks(dh distr.Hooks, sh slashing.Hooks) Hooks

func (Hooks) OnDelegationCreated

func (h Hooks) OnDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

func (Hooks) OnDelegationRemoved

func (h Hooks) OnDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

func (Hooks) OnDelegationSharesModified

func (h Hooks) OnDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

func (Hooks) OnSelfDelDropBelowMin

func (h Hooks) OnSelfDelDropBelowMin(ctx sdk.Context, operator sdk.ValAddress)

func (Hooks) OnSideChainValidatorBeginUnbonding

func (h Hooks) OnSideChainValidatorBeginUnbonding(ctx sdk.Context, sideConsAddr []byte, operator sdk.ValAddress)

func (Hooks) OnSideChainValidatorBonded

func (h Hooks) OnSideChainValidatorBonded(ctx sdk.Context, sideConsAddr []byte, operator sdk.ValAddress)

func (Hooks) OnValidatorBeginUnbonding

func (h Hooks) OnValidatorBeginUnbonding(ctx sdk.Context, addr sdk.ConsAddress, operator sdk.ValAddress)

func (Hooks) OnValidatorBonded

func (h Hooks) OnValidatorBonded(ctx sdk.Context, addr sdk.ConsAddress, operator sdk.ValAddress)

func (Hooks) OnValidatorCreated

func (h Hooks) OnValidatorCreated(ctx sdk.Context, addr sdk.ValAddress)

nolint

func (Hooks) OnValidatorModified

func (h Hooks) OnValidatorModified(ctx sdk.Context, addr sdk.ValAddress)

func (Hooks) OnValidatorRemoved

func (h Hooks) OnValidatorRemoved(ctx sdk.Context, addr sdk.ValAddress)

Jump to

Keyboard shortcuts

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