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 Hooks
- func (h Hooks) OnDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h Hooks) OnDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h Hooks) OnDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h Hooks) OnValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h Hooks) OnValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h Hooks) OnValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
- func (h Hooks) OnValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress)
- func (h Hooks) OnValidatorPowerDidChange(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h Hooks) OnValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- type ProtocolVersion0
- func (p *ProtocolVersion0) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (p *ProtocolVersion0) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (p *ProtocolVersion0) ExportAppStateAndValidators(ctx sdk.Context, forZeroHeight bool) (appState json.RawMessage, validators []tmtypes.GenesisValidator, err error)
- func (p *ProtocolVersion0) GetAnteHandler() sdk.AnteHandler
- func (p *ProtocolVersion0) GetBeginBlocker() sdk.BeginBlocker
- func (p *ProtocolVersion0) GetCodec() *codec.Codec
- func (p *ProtocolVersion0) GetDefinition() common.ProtocolDefinition
- func (p *ProtocolVersion0) GetEndBlocker() sdk.EndBlocker
- func (p *ProtocolVersion0) GetFeePreprocessHandler() sdk.FeePreprocessHandler
- func (p *ProtocolVersion0) GetFeeRefundHandler() sdk.FeeRefundHandler
- func (p *ProtocolVersion0) GetInitChainer() sdk.InitChainer1
- func (p *ProtocolVersion0) GetKVStoreKeyList() []*sdk.KVStoreKey
- func (p *ProtocolVersion0) GetQueryRouter() protocol.QueryRouter
- func (p *ProtocolVersion0) GetRouter() protocol.Router
- func (p *ProtocolVersion0) Init()
- func (p *ProtocolVersion0) InitChainer(ctx sdk.Context, DeliverTx sdk.DeliverTx, req abci.RequestInitChain) abci.ResponseInitChain
- func (p *ProtocolVersion0) Load(protocolkeeper protocolKeeper.Keeper)
Constants ¶
const (
// DefaultKeyPass contains the default key password for genesis transactions
DefaultKeyPass = "1234567890"
)
Variables ¶
var ( FeeAmt = int64(100) IrisCt = types.NewDefaultCoinType(stakeTypes.StakeDenomName) FreeFermionVal, _ = IrisCt.ConvertToMinCoin(fmt.Sprintf("%d%s", FeeAmt, stakeTypes.StakeDenomName)) FreeFermionAcc, _ = IrisCt.ConvertToMinCoin(fmt.Sprintf("%d%s", int64(150), stakeTypes.StakeDenomName)) )
Functions ¶
func CollectStdTxs ¶
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 ¶
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 uint64 `json:"sequence_number"`
AccountNumber uint64 `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 ¶
type GenesisFileAccount struct {
Address sdk.AccAddress `json:"address"`
Coins []string `json:"coins"`
Sequence uint64 `json:"sequence_number"`
AccountNumber uint64 `json:"account_number"`
}
func NewDefaultGenesisFileAccount ¶
func NewDefaultGenesisFileAccount(addr sdk.AccAddress) GenesisFileAccount
func NewGenesisFileAccount ¶
func NewGenesisFileAccount(acc *auth.BaseAccount) GenesisFileAccount
type GenesisFileState ¶
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 ¶
func NewDefaultGenesisFileState() GenesisFileState
NewDefaultGenesisState generates the default state for iris.
func NewGenesisFileState ¶
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 ¶
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 Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Combined Staking 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) OnValidatorBeginUnbonding ¶
func (h Hooks) OnValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
func (Hooks) OnValidatorBonded ¶
func (h Hooks) OnValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
func (Hooks) OnValidatorCreated ¶
func (h Hooks) OnValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
func (Hooks) OnValidatorModified ¶
func (h Hooks) OnValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress)
func (Hooks) OnValidatorPowerDidChange ¶
func (h Hooks) OnValidatorPowerDidChange(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
func (Hooks) OnValidatorRemoved ¶
func (h Hooks) OnValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
type ProtocolVersion0 ¶
func NewProtocolVersion0 ¶
func NewProtocolVersion0(cdc *codec.Codec) *ProtocolVersion0
func (*ProtocolVersion0) BeginBlocker ¶
func (p *ProtocolVersion0) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
application updates every end block
func (*ProtocolVersion0) EndBlocker ¶
func (p *ProtocolVersion0) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
application updates every end block
func (*ProtocolVersion0) ExportAppStateAndValidators ¶
func (p *ProtocolVersion0) ExportAppStateAndValidators(ctx sdk.Context, forZeroHeight bool) ( appState json.RawMessage, validators []tmtypes.GenesisValidator, err error)
export the state of gaia for a genesis file
func (*ProtocolVersion0) GetAnteHandler ¶
func (p *ProtocolVersion0) GetAnteHandler() sdk.AnteHandler
func (*ProtocolVersion0) GetBeginBlocker ¶
func (p *ProtocolVersion0) GetBeginBlocker() sdk.BeginBlocker
func (*ProtocolVersion0) GetCodec ¶
func (p *ProtocolVersion0) GetCodec() *codec.Codec
func (*ProtocolVersion0) GetDefinition ¶
func (p *ProtocolVersion0) GetDefinition() common.ProtocolDefinition
func (*ProtocolVersion0) GetEndBlocker ¶
func (p *ProtocolVersion0) GetEndBlocker() sdk.EndBlocker
func (*ProtocolVersion0) GetFeePreprocessHandler ¶
func (p *ProtocolVersion0) GetFeePreprocessHandler() sdk.FeePreprocessHandler
func (*ProtocolVersion0) GetFeeRefundHandler ¶
func (p *ProtocolVersion0) GetFeeRefundHandler() sdk.FeeRefundHandler
func (*ProtocolVersion0) GetInitChainer ¶
func (p *ProtocolVersion0) GetInitChainer() sdk.InitChainer1
func (*ProtocolVersion0) GetKVStoreKeyList ¶
func (p *ProtocolVersion0) GetKVStoreKeyList() []*sdk.KVStoreKey
configure all Stores
func (*ProtocolVersion0) GetQueryRouter ¶
func (p *ProtocolVersion0) GetQueryRouter() protocol.QueryRouter
func (*ProtocolVersion0) GetRouter ¶
func (p *ProtocolVersion0) GetRouter() protocol.Router
func (*ProtocolVersion0) InitChainer ¶
func (p *ProtocolVersion0) InitChainer(ctx sdk.Context, DeliverTx sdk.DeliverTx, req abci.RequestInitChain) abci.ResponseInitChain
custom logic for iris initialization just 0 version need Initchainer
func (*ProtocolVersion0) Load ¶
func (p *ProtocolVersion0) Load(protocolkeeper protocolKeeper.Keeper)
load the configuration of this Protocol