app

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DefaultKeyPass contains the default key password for genesis transactions
	DefaultKeyPass = "1234567890"
)
View Source
const (
	FlagReplay = "replay"
)

Variables

View Source
var (
	DefaultLCDHome  = os.ExpandEnv("$HOME/.irislcd")
	DefaultCLIHome  = os.ExpandEnv("$HOME/.iriscli")
	DefaultNodeHome = os.ExpandEnv("$HOME/.iris")
)

default home directories for expected binaries

View Source
var (
	Denom             = "iris"
	StakeDenom        = Denom + "-" + types.Atto
	FeeAmt            = int64(100)
	IrisCt            = types.NewDefaultCoinType(Denom)
	FreeFermionVal, _ = IrisCt.ConvertToMinCoin(fmt.Sprintf("%d%s", FeeAmt, Denom))
	FreeFermionAcc, _ = IrisCt.ConvertToMinCoin(fmt.Sprintf("%d%s", int64(150), Denom))
)

Functions

func CollectStdTxs added in v0.7.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 IrisAppGenStateJSON

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

IrisAppGenState but with JSON

func IrisAppInit

func IrisAppInit() server.AppInit

get app init parameters for server init command

func IrisValidateGenesisState added in v0.7.0

func IrisValidateGenesisState(genesisState GenesisState) (err error)

IrisValidateGenesisState 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 GenesisAccount

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

GenesisAccount doesn't need pubkey or sequence

func NewDefaultGenesisAccount added in v0.7.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() (acc *auth.BaseAccount)

convert GenesisAccount to auth.BaseAccount

type GenesisState

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

State to Unmarshal

func IrisAppGenState

func IrisAppGenState(cdc *codec.Codec, genDoc tmtypes.GenesisDoc, appGenTxs []json.RawMessage) (
	genesisState GenesisState, err error)

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

func NewDefaultGenesisState added in v0.7.0

func NewDefaultGenesisState() GenesisState

NewDefaultGenesisState generates the default state for gaia.

func NewGenesisState added in v0.7.0

func NewGenesisState(accounts []GenesisAccount, authData auth.GenesisState, stakeData stake.GenesisState, mintData mint.GenesisState,
	distrData distr.GenesisState, govData gov.GenesisState, upgradeData upgrade.GenesisState, serviceData service.GenesisState, slashingData slashing.GenesisState) GenesisState

type Hooks added in v0.7.0

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

Combined Staking Hooks

func NewHooks added in v0.7.0

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

func (Hooks) OnDelegationCreated added in v0.7.0

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

func (Hooks) OnDelegationRemoved added in v0.7.0

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

func (Hooks) OnDelegationSharesModified added in v0.7.0

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

func (Hooks) OnValidatorBeginUnbonding added in v0.7.0

func (h Hooks) OnValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

func (Hooks) OnValidatorBonded added in v0.7.0

func (h Hooks) OnValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

func (Hooks) OnValidatorCreated added in v0.7.0

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

func (Hooks) OnValidatorModified added in v0.7.0

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

func (Hooks) OnValidatorPowerDidChange added in v0.7.0

func (h Hooks) OnValidatorPowerDidChange(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

func (Hooks) OnValidatorRemoved added in v0.7.0

func (h Hooks) OnValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

type IrisApp

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

Extended ABCI application

func NewIrisApp

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

func (*IrisApp) BeginBlocker

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

application updates every end block

func (*IrisApp) EndBlocker

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

application updates every end block

func (*IrisApp) ExportAppStateAndValidators

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

export the state of iris for a genesis file

Jump to

Keyboard shortcuts

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