Documentation ¶
Index ¶
- Constants
- Variables
- func CollectStdTxs(cdc *codec.Codec, moniker string, genTxsDir string, genDoc tmtypes.GenesisDoc) (appGenTxs []auth.StdTx, persistentPeers string, err error)
- func HashgardAppGenStateJSON(cdc *codec.Codec, genDoc tmtypes.GenesisDoc, appGenTxs []json.RawMessage) (appState json.RawMessage, err error)
- func HashgardValidateGenesisState(genesisState GenesisState) error
- func MakeCodec() *codec.Codec
- type GenesisAccount
- type GenesisState
- type HashgardApp
- func (app *HashgardApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *HashgardApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *HashgardApp) ExportAppStateAndValidators(forZeroHeight bool) (appState json.RawMessage, validators []tmtypes.GenesisValidator, err error)
- func (app *HashgardApp) LoadHeight(height int64) error
- type StakingHooks
- func (h StakingHooks) OnDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h StakingHooks) OnDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h StakingHooks) OnDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h StakingHooks) OnValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h StakingHooks) OnValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h StakingHooks) OnValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
- func (h StakingHooks) OnValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress)
- func (h StakingHooks) OnValidatorPowerDidChange(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h StakingHooks) OnValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
Constants ¶
const ( FlagReplay = "replay" // DefaultKeyPass contains key password for genesis transactions DefaultKeyPass = "12345678" )
const ( GasDenom = "horn" StakeDenom = "apple" )
Variables ¶
var ( DefaultLCDHome = os.ExpandEnv("$HOME/.hashgardlcd") DefaultNodeHome = os.ExpandEnv("$HOME/.hashgard") DefaultCLIHome = os.ExpandEnv("$HOME/.hashgardcli") )
default home directories for expected binaries
var ( // bonded tokens given to genesis validators/accounts FreeFermionVal = int64(100) FreeFermionsAcc = sdk.NewInt(150) )
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 HashgardAppGenStateJSON ¶
func HashgardAppGenStateJSON(cdc *codec.Codec, genDoc tmtypes.GenesisDoc, appGenTxs []json.RawMessage) (appState json.RawMessage, err error)
HashgardAppGenState but with JSON
func HashgardValidateGenesisState ¶
func HashgardValidateGenesisState(genesisState GenesisState) error
HashgardValidateGenesisState 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"` }
nolint
func NewDefaultGenesisAccount ¶
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"` DistributionData distribution.GenesisState `json:"distribution"` SlashingData slashing.GenesisState `json:"slashing"` GovData gov.GenesisState `json:"gov"` GenTxs []json.RawMessage `json:"gentxs"` }
State to Unmarshal
func HashgardAppGenState ¶
func HashgardAppGenState(cdc *codec.Codec, genDoc tmtypes.GenesisDoc, appGenTxs []json.RawMessage) (genesisState GenesisState, err error)
Create the core parameters for genesis initialization for hashgard note that the pubkey input is this machines pubkey
func NewDefaultGenesisState ¶
func NewDefaultGenesisState() GenesisState
NewDefaultGenesisState generates the default state for hashgard.
func NewGenesisState ¶
func NewGenesisState( accounts []GenesisAccount, authData auth.GenesisState, stakeData stake.GenesisState, mintData mint.GenesisState, distrData distribution.GenesisState, slashingData slashing.GenesisState, govData gov.GenesisState, ) GenesisState
type HashgardApp ¶
Extended ABCI application
func NewHashgardApp ¶
func NewHashgardApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, baseAppOptions ...func(*bam.BaseApp)) *HashgardApp
NewHashgardApp returns a reference to an initialized HashgardApp.
func (*HashgardApp) BeginBlocker ¶
func (app *HashgardApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
BeginBlocker reflects logic to run before any TXs application are processed by the application.
func (*HashgardApp) EndBlocker ¶
func (app *HashgardApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
EndBlocker reflects logic to run after all TXs are processed by the application. Application updates every end block. nolint: unparam
func (*HashgardApp) ExportAppStateAndValidators ¶
func (app *HashgardApp) ExportAppStateAndValidators(forZeroHeight bool) ( appState json.RawMessage, validators []tmtypes.GenesisValidator, err error)
export the state of hashgard for a genesis file
func (*HashgardApp) LoadHeight ¶
func (app *HashgardApp) LoadHeight(height int64) error
load a particular height
type StakingHooks ¶
type StakingHooks struct {
// contains filtered or unexported fields
}
StakingHooks contains combined distribution and slashing hooks needed for the staking module.
func NewStakingHooks ¶
func NewStakingHooks(dh distribution.Hooks, sh slashing.Hooks) StakingHooks
func (StakingHooks) OnDelegationCreated ¶
func (h StakingHooks) OnDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (StakingHooks) OnDelegationRemoved ¶
func (h StakingHooks) OnDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (StakingHooks) OnDelegationSharesModified ¶
func (h StakingHooks) OnDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (StakingHooks) OnValidatorBeginUnbonding ¶
func (h StakingHooks) OnValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
func (StakingHooks) OnValidatorBonded ¶
func (h StakingHooks) OnValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
func (StakingHooks) OnValidatorCreated ¶
func (h StakingHooks) OnValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
nolint
func (StakingHooks) OnValidatorModified ¶
func (h StakingHooks) OnValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress)
func (StakingHooks) OnValidatorPowerDidChange ¶
func (h StakingHooks) OnValidatorPowerDidChange(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
func (StakingHooks) OnValidatorRemoved ¶
func (h StakingHooks) OnValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)