Documentation ¶
Overview ¶
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: cschain/modules/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 AddGenTxsInAppGenesisState(cdc codec.JSONCodec, txJSONEncoder sdk.TxEncoder, ...) (map[string]json.RawMessage, error)
- func CollectTxs(cdc codec.JSONCodec, txJSONDecoder sdk.TxDecoder, moniker, genTxsDir string, ...) (appGenTxs []sdk.Tx, persistentPeers string, err error)
- func DeliverGenTxs(ctx sdk.Context, genTxs []json.RawMessage, nodeKeeper types.NodeKeeper, ...) []abci.ValidatorUpdate
- func ExportGenesisFile(genDoc *tmtypes.GenesisDoc, genFile string) error
- func ExportGenesisFileWithTime(genFile, chainID string, validators []tmtypes.GenesisValidator, ...) error
- func GenAppStateFromConfig(cdc codec.JSONCodec, txEncodingConfig client.TxEncodingConfig, ...) (appState json.RawMessage, err error)
- func Genkey(privKey crypto.PrivKey) ([]byte, error)
- func InitGenesis(ctx sdk.Context, nodeKeeper types.NodeKeeper, deliverTx deliverTxfn, ...) []abci.ValidatorUpdate
- func InitializeNodeValidatorFiles(config *cfg.Config) (nodeKey *p2p.NodeKey, pv *privval.FilePV, err error)
- func NewAppModule(accountKeeper types.AccountKeeper, nodeKeeper types.NodeKeeper, ...) module.AppModule
- type AppMap
- type AppModule
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
- func (AppModuleBasic) GetQueryCmd() *cobra.Command
- func (AppModuleBasic) GetTxCmd() *cobra.Command
- func (AppModuleBasic) Name() string
- func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
- func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error
- type GenesisState
- type InitConfig
- type MigrationCallback
- type MigrationMap
Constants ¶
const (
ModuleName = types.ModuleName
)
Variables ¶
var ( // functions aliases NewGenesisState = types.NewGenesisState 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 AddGenTxsInAppGenesisState ¶
func AddGenTxsInAppGenesisState( cdc codec.JSONCodec, txJSONEncoder sdk.TxEncoder, appGenesisState map[string]json.RawMessage, genTxs []sdk.Tx, ) (map[string]json.RawMessage, error)
AddGenTxsInAppGenesisState - add the genesis transactions in the app genesis state
func CollectTxs ¶
func CollectTxs( cdc codec.JSONCodec, txJSONDecoder sdk.TxDecoder, moniker, genTxsDir string, genDoc tmtypes.GenesisDoc, ) ( appGenTxs []sdk.Tx, persistentPeers string, err error, )
CollectTxs processes and validates application's genesis Txs and returns the list of appGenTxs, and persistent peers required to generate genesis.json.
func DeliverGenTxs ¶
func DeliverGenTxs( ctx sdk.Context, genTxs []json.RawMessage, nodeKeeper types.NodeKeeper, deliverTx deliverTxfn, txEncodingConfig client.TxEncodingConfig, ) []abci.ValidatorUpdate
DeliverGenTxs iterates over all genesis txs, decodes each into a StdTx and invokes the provided deliverTxfn with the decoded StdTx. It returns the result of the node module's ApplyAndReturnValidatorSetUpdates.
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.JSONCodec, txEncodingConfig client.TxEncodingConfig, config *cfg.Config, initCfg InitConfig, genDoc tmtypes.GenesisDoc, ) (appState json.RawMessage, err error)
GenAppStateFromConfig gets the genesis app state from the config
func InitGenesis ¶
func InitGenesis( ctx sdk.Context, nodeKeeper types.NodeKeeper, deliverTx deliverTxfn, genesisState types.GenesisState, txEncodingConfig client.TxEncodingConfig, ) []abci.ValidatorUpdate
InitGenesis - initialize accounts and deliver genesis transactions
func InitializeNodeValidatorFiles ¶
func InitializeNodeValidatorFiles(config *cfg.Config) (nodeKey *p2p.NodeKey, pv *privval.FilePV, err error)
InitializeNodeValidatorFiles creates private validator and p2p configuration files.
func NewAppModule ¶
func NewAppModule( accountKeeper types.AccountKeeper, nodeKeeper types.NodeKeeper, deliverTx deliverTxfn, txEncodingConfig client.TxEncodingConfig, ) module.AppModule
NewAppModule creates a new AppModule object
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
AppModule implements an application module for the genutil module.
func (AppModule) ConsensusVersion ¶
ConsensusVersion implements AppModule/ConsensusVersion.
func (AppModule) ExportGenesis ¶
ExportGenesis returns the exported genesis state as raw bytes for the genutil module.
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis performs genesis initialization for the genutil module. It returns no validator updates.
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic defines the basic application module used by the genutil module.
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
DefaultGenesis returns default genesis state as raw bytes for the genutil module.
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd() *cobra.Command
GetQueryCmd returns no root query command for the genutil module.
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd() *cobra.Command
GetTxCmd returns no root tx command for the genutil module.
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
Name returns the genutil module's name.
func (AppModuleBasic) RegisterGRPCGatewayRoutes ¶
func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the genutil module.
func (AppModuleBasic) RegisterInterfaces ¶
func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces registers interfaces and implementations of the genutil module.
func (AppModuleBasic) RegisterLegacyAminoCodec ¶
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
RegisterLegacyAminoCodec registers the genutil module's types for the given codec.
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router)
RegisterRESTRoutes registers the REST routes for the genutil module.
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error
ValidateGenesis performs genesis state validation for the genutil module.
type GenesisState ¶
type GenesisState = types.GenesisState
type InitConfig ¶
type InitConfig = types.InitConfig
type MigrationCallback ¶
type MigrationCallback = types.MigrationCallback
type MigrationMap ¶
type MigrationMap = types.MigrationMap