app

package
v0.30.0-dev2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: Apache-2.0 Imports: 31 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 added in v0.25.0

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

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

func GaiaAppGenStateJSON added in v0.18.0

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

GaiaAppGenState but with JSON

func GaiaValidateGenesisState added in v0.25.0

func GaiaValidateGenesisState(genesisState GenesisState) 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, loadLatest bool, baseAppOptions ...func(*bam.BaseApp)) *GaiaApp

NewGaiaApp returns a reference to an initialized GaiaApp.

func (*GaiaApp) BeginBlocker added in v0.18.0

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

application updates every end block

func (*GaiaApp) EndBlocker added in v0.18.0

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

application updates every end block nolint: unparam

func (*GaiaApp) ExportAppStateAndValidators added in v0.19.0

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

export the state of gaia for a genesis file

func (*GaiaApp) LoadHeight added in v0.27.0

func (app *GaiaApp) LoadHeight(height int64) error

load a particular height

type GenesisAccount

type GenesisAccount struct {
	Address       sdk.AccAddress `json:"address"`
	Coins         sdk.Coins      `json:"coins"`
	Sequence      uint64         `json:"sequence_number"`
	AccountNumber uint64         `json:"account_number"`

	// vesting account fields
	OriginalVesting  sdk.Coins `json:"original_vesting"`  // total vesting coins upon initialization
	DelegatedFree    sdk.Coins `json:"delegated_free"`    // delegated vested coins at time of delegation
	DelegatedVesting sdk.Coins `json:"delegated_vesting"` // delegated vesting coins at time of delegation
	StartTime        int64     `json:"start_time"`        // vesting start time
	EndTime          int64     `json:"end_time"`          // vesting end time
}

GenesisAccount defines an account initialized at genesis.

func NewDefaultGenesisAccount added in v0.25.0

func NewDefaultGenesisAccount(addr sdk.AccAddress) GenesisAccount

func NewGenesisAccount

func NewGenesisAccount(acc *auth.BaseAccount) GenesisAccount

func NewGenesisAccountI

func NewGenesisAccountI(acc auth.Account) GenesisAccount

func (*GenesisAccount) ToAccount

func (ga *GenesisAccount) ToAccount() auth.Account

convert GenesisAccount to auth.BaseAccount

type GenesisState

type GenesisState struct {
	Accounts     []GenesisAccount      `json:"accounts"`
	AuthData     auth.GenesisState     `json:"auth"`
	StakingData  staking.GenesisState  `json:"staking"`
	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, genDoc tmtypes.GenesisDoc, 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 NewDefaultGenesisState added in v0.26.0

func NewDefaultGenesisState() GenesisState

NewDefaultGenesisState generates the default state for gaia.

func NewGenesisState added in v0.25.0

func NewGenesisState(accounts []GenesisAccount, authData auth.GenesisState,
	stakingData staking.GenesisState, mintData mint.GenesisState,
	distrData distr.GenesisState, govData gov.GenesisState,
	slashingData slashing.GenesisState) GenesisState

type StakingHooks added in v0.28.0

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

StakingHooks contains combined distribution and slashing hooks needed for the staking module.

func NewStakingHooks added in v0.28.0

func NewStakingHooks(dh distr.Hooks, sh slashing.Hooks) StakingHooks

func (StakingHooks) AfterDelegationModified added in v0.30.0

func (h StakingHooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

func (StakingHooks) AfterValidatorBeginUnbonding added in v0.30.0

func (h StakingHooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

func (StakingHooks) AfterValidatorBonded added in v0.30.0

func (h StakingHooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

func (StakingHooks) AfterValidatorCreated added in v0.30.0

func (h StakingHooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)

nolint

func (StakingHooks) AfterValidatorPowerDidChange added in v0.30.0

func (h StakingHooks) AfterValidatorPowerDidChange(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

func (StakingHooks) AfterValidatorRemoved added in v0.30.0

func (h StakingHooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

func (StakingHooks) BeforeDelegationCreated added in v0.30.0

func (h StakingHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

func (StakingHooks) BeforeDelegationRemoved added in v0.30.0

func (h StakingHooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

func (StakingHooks) BeforeDelegationSharesModified added in v0.30.0

func (h StakingHooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

func (StakingHooks) BeforeValidatorModified added in v0.30.0

func (h StakingHooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress)

func (StakingHooks) BeforeValidatorSlashed added in v0.30.0

func (h StakingHooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec)

Jump to

Keyboard shortcuts

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