Documentation ¶
Overview ¶
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: hschain/x/genutil/types
Package genutil contains a variety of genesis utility functionality for usage within a blockchain application. Namely:
- Genesis transactions related (gentx)
- commands for collection and creation of gentxs
- initchain processing of gentxs
- Genesis file validation
- Tendermint related initialization
Index ¶
- Constants
- Variables
- func CollectStdTxs(cdc *codec.Codec, moniker, genTxsDir string, genDoc tmtypes.GenesisDoc, ...) (appGenTxs []authtypes.StdTx, persistentPeers string, err error)
- func DeliverGenTxs(ctx sdk.Context, cdc *codec.Codec, genTxs []json.RawMessage, ...) []abci.ValidatorUpdate
- func ExportGenesisFile(genDoc *tmtypes.GenesisDoc, genFile string) error
- func ExportGenesisFileWithTime(genFile, chainID string, validators []tmtypes.GenesisValidator, ...) error
- func GenAppStateFromConfig(cdc *codec.Codec, config *cfg.Config, initCfg InitConfig, ...) (appState json.RawMessage, err error)
- func InitGenesis(ctx sdk.Context, cdc *codec.Codec, stakingKeeper types.StakingKeeper, ...) []abci.ValidatorUpdate
- func InitializeNodeValidatorFiles(config *cfg.Config) (nodeID string, valPubKey crypto.PubKey, err error)
- func NewAppModule(accountKeeper types.AccountKeeper, stakingKeeper types.StakingKeeper, ...) module.AppModule
- func SetGenTxsInAppGenesisState(cdc *codec.Codec, appGenesisState map[string]json.RawMessage, ...) (map[string]json.RawMessage, error)
- func ValidateAccountInGenesis(appGenesisState map[string]json.RawMessage, ...) error
- type AppMap
- type AppModule
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(_ *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(_ *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(_ context.CLIContext, _ *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type GenesisState
- type InitConfig
- type MigrationCallback
- type MigrationMap
Constants ¶
const (
ModuleName = types.ModuleName
)
Variables ¶
var ( // functions aliases NewGenesisState = types.NewGenesisState NewGenesisStateFromStdTx = types.NewGenesisStateFromStdTx NewInitConfig = types.NewInitConfig GetGenesisStateFromAppState = types.GetGenesisStateFromAppState SetGenesisStateInAppState = types.SetGenesisStateInAppState GenesisStateFromGenDoc = types.GenesisStateFromGenDoc GenesisStateFromGenFile = types.GenesisStateFromGenFile ValidateGenesis = types.ValidateGenesis // variable aliases ModuleCdc = types.ModuleCdc )
Functions ¶
func CollectStdTxs ¶
func CollectStdTxs(cdc *codec.Codec, moniker, genTxsDir string, genDoc tmtypes.GenesisDoc, genAccIterator types.GenesisAccountsIterator, ) (appGenTxs []authtypes.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 DeliverGenTxs ¶
func DeliverGenTxs(ctx sdk.Context, cdc *codec.Codec, genTxs []json.RawMessage, stakingKeeper types.StakingKeeper, deliverTx deliverTxfn) []abci.ValidatorUpdate
DeliverGenTxs - deliver a genesis transaction
func ExportGenesisFile ¶
func ExportGenesisFile(genDoc *tmtypes.GenesisDoc, genFile string) error
ExportGenesisFile creates and writes the genesis configuration to disk. An error is returned if building or writing the configuration to file fails.
func ExportGenesisFileWithTime ¶
func ExportGenesisFileWithTime( genFile, chainID string, validators []tmtypes.GenesisValidator, appState json.RawMessage, genTime time.Time, ) error
ExportGenesisFileWithTime creates and writes the genesis configuration to disk. An error is returned if building or writing the configuration to file fails.
func GenAppStateFromConfig ¶
func GenAppStateFromConfig(cdc *codec.Codec, config *cfg.Config, initCfg InitConfig, genDoc tmtypes.GenesisDoc, genAccIterator types.GenesisAccountsIterator, ) (appState json.RawMessage, err error)
GenAppStateFromConfig gets the genesis app state from the config
func InitGenesis ¶
func InitGenesis( ctx sdk.Context, cdc *codec.Codec, stakingKeeper types.StakingKeeper, deliverTx deliverTxfn, genesisState GenesisState, ) []abci.ValidatorUpdate
InitGenesis - initialize accounts and deliver genesis transactions
func InitializeNodeValidatorFiles ¶
func InitializeNodeValidatorFiles(config *cfg.Config, ) (nodeID string, valPubKey crypto.PubKey, err error)
InitializeNodeValidatorFiles creates private validator and p2p configuration files.
func NewAppModule ¶
func NewAppModule(accountKeeper types.AccountKeeper, stakingKeeper types.StakingKeeper, deliverTx deliverTxfn) module.AppModule
NewAppModule creates a new AppModule object
func SetGenTxsInAppGenesisState ¶
func SetGenTxsInAppGenesisState(cdc *codec.Codec, appGenesisState map[string]json.RawMessage, genTxs []authtypes.StdTx) (map[string]json.RawMessage, error)
SetGenTxsInAppGenesisState - sets the genesis transactions in the app genesis state
func ValidateAccountInGenesis ¶
func ValidateAccountInGenesis(appGenesisState map[string]json.RawMessage, genAccIterator types.GenesisAccountsIterator, key sdk.AccAddress, coins sdk.Coins, cdc *codec.Codec) error
ValidateAccountInGenesis checks that the provided key has sufficient coins in the genesis accounts
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
___________________________ app module
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
module export genesis
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
module init-genesis
type AppModuleBasic ¶
type AppModuleBasic struct{}
app module basics object
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
default genesis state
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(_ *codec.Codec) *cobra.Command
get the root query command of this module
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(_ *codec.Codec) *cobra.Command
get the root tx command of this module
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
register module codec
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(_ context.CLIContext, _ *mux.Router)
register rest routes
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
module validate genesis
type GenesisState ¶
type GenesisState = types.GenesisState
type InitConfig ¶
type InitConfig = types.InitConfig
type MigrationCallback ¶
type MigrationCallback = types.MigrationCallback
type MigrationMap ¶
type MigrationMap = types.MigrationMap