app

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 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"
)
View Source
const LastProtocolVersion = 0

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 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 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 GenesisFileAccount added in v0.8.0

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

func NewDefaultGenesisFileAccount added in v0.8.0

func NewDefaultGenesisFileAccount(addr sdk.AccAddress) GenesisFileAccount

func NewGenesisFileAccount added in v0.8.0

func NewGenesisFileAccount(acc *auth.BaseAccount) GenesisFileAccount

type GenesisFileState added in v0.8.0

type GenesisFileState struct {
	Accounts        []GenesisFileAccount     `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"`
	GuardianData    guardian.GenesisState    `json:"guardian"`
	ArbitrationData arbitration.GenesisState `json:"arbitration"`
	GenTxs          []json.RawMessage        `json:"gentxs"`
}

func IrisAppGenState

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

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

func NewDefaultGenesisFileState added in v0.8.0

func NewDefaultGenesisFileState() GenesisFileState

NewDefaultGenesisState generates the default state for iris.

func NewGenesisFileState added in v0.8.0

func NewGenesisFileState(accounts []GenesisFileAccount, authData auth.GenesisState, stakeData stake.GenesisState, mintData mint.GenesisState,
	distrData distr.GenesisState, govData gov.GenesisState, upgradeData upgrade.GenesisState, serviceData service.GenesisState,
	arbitrationData arbitration.GenesisState, guardianData guardian.GenesisState, slashingData slashing.GenesisState) GenesisFileState

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"`
	ArbitrationData arbitration.GenesisState `json:"arbitration"`
	GuardianData    guardian.GenesisState    `json:"guardian"`
	GenTxs          []json.RawMessage        `json:"gentxs"`
}

State to Unmarshal

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,
	arbitrationData arbitration.GenesisState, guardianData guardian.GenesisState, slashingData slashing.GenesisState) GenesisState

type Hook added in v0.8.0

type Hook interface{}

type HookHub added in v0.8.0

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

func NewHooksHub added in v0.8.0

func NewHooksHub(keeper upgrade.Keeper) HookHub

func (HookHub) AddHook added in v0.8.0

func (hkhub HookHub) AddHook(trigger string, version int64, hk Hook) (hkh HookHub)

func (HookHub) GetCurrentVersionHooks added in v0.8.0

func (h HookHub) GetCurrentVersionHooks(ctx sdk.Context, trigger string) hooks

func (HookHub) GetHooks added in v0.8.0

func (hkhub HookHub) GetHooks(trigger string, version int64) (hk hooks)

func (HookHub) OnDelegationCreated added in v0.8.0

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

func (HookHub) OnDelegationRemoved added in v0.8.0

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

func (HookHub) OnDelegationSharesModified added in v0.8.0

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

func (HookHub) OnValidatorBeginUnbonding added in v0.8.0

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

func (HookHub) OnValidatorBonded added in v0.8.0

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

func (HookHub) OnValidatorCreated added in v0.8.0

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

______________________________________________________________________________________________ functions for StakingHooks

func (HookHub) OnValidatorModified added in v0.8.0

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

func (HookHub) OnValidatorPowerDidChange added in v0.8.0

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

func (HookHub) OnValidatorRemoved added in v0.8.0

func (h HookHub) 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

func (*IrisApp) LoadHeight added in v0.8.0

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

Jump to

Keyboard shortcuts

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