Documentation
¶
Index ¶
- Constants
- Variables
- func CollectStdTxs(cdc *codec.Codec, moniker string, genTxsDir string, genDoc tmtypes.GenesisDoc) (appGenTxs []auth.StdTx, persistentPeers string, err error)
- func IrisAppGenStateJSON(cdc *codec.Codec, genDoc tmtypes.GenesisDoc, appGenTxs []json.RawMessage) (appState json.RawMessage, err error)
- func IrisValidateGenesisState(genesisState GenesisState) (err error)
- func MakeCodec() *codec.Codec
- type GenesisAccount
- type GenesisFileAccount
- type GenesisFileState
- type GenesisState
- type Hook
- type HookHub
- func (hkhub HookHub) AddHook(trigger string, version int64, hk Hook) (hkh HookHub)
- func (h HookHub) GetCurrentVersionHooks(ctx sdk.Context, trigger string) hooks
- func (hkhub HookHub) GetHooks(trigger string, version int64) (hk hooks)
- func (h HookHub) OnDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h HookHub) OnDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h HookHub) OnDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h HookHub) OnValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h HookHub) OnValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h HookHub) OnValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
- func (h HookHub) OnValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress)
- func (h HookHub) OnValidatorPowerDidChange(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h HookHub) OnValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- type IrisApp
- func (app *IrisApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *IrisApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *IrisApp) ExportAppStateAndValidators() (appState json.RawMessage, validators []tmtypes.GenesisValidator, err error)
- func (app *IrisApp) LoadHeight(height int64) error
Constants ¶
const (
// DefaultKeyPass contains the default key password for genesis transactions
DefaultKeyPass = "1234567890"
)
const (
FlagReplay = "replay"
)
const LastProtocolVersion = 0
Variables ¶
var ( DefaultLCDHome = os.ExpandEnv("$HOME/.irislcd") DefaultCLIHome = os.ExpandEnv("$HOME/.iriscli") DefaultNodeHome = os.ExpandEnv("$HOME/.iris") )
default home directories for expected binaries
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)
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 HookHub ¶ added in v0.8.0
type HookHub struct {
// contains filtered or unexported fields
}
func NewHooksHub ¶ added in v0.8.0
func (HookHub) GetCurrentVersionHooks ¶ added in v0.8.0
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 ¶
Extended ABCI application
func NewIrisApp ¶
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