Documentation ¶
Index ¶
- Constants
- Variables
- func DeliverGenTxs(ctx sdk.Context, cdc *codec.Codec, genTxs []json.RawMessage, ...) ([]abci.ValidatorUpdate, error)
- func GenesisStateFromGenDoc(cdc *codec.Codec, genDoc tmtypes.GenesisDoc) (genesisState map[string]json.RawMessage, err error)
- func GenesisStateFromGenFile(cdc *codec.Codec, genFile string) (genesisState map[string]json.RawMessage, genDoc *tmtypes.GenesisDoc, err error)
- func InitGenesis(ctx sdk.Context, cdc *codec.Codec, validatorKeeper validator.Keeper, ...) []abci.ValidatorUpdate
- func InitializeNodeValidatorFiles(config *cfg.Config) (nodeID string, valPubKey crypto.PubKey, err error)
- func NewAppModule(accountKeeper types.AccountKeeper, validatorKeeper validator.Keeper, ...) module.AppModule
- func SetGenTxsInAppGenesisState(cdc *codec.Codec, appGenesisState map[string]json.RawMessage, ...) (map[string]json.RawMessage, error)
- func SetGenesisStateInAppState(cdc *codec.Codec, appState map[string]json.RawMessage, ...) map[string]json.RawMessage
- func ValidateAccountInGenesis(appGenesisState map[string]json.RawMessage, ...) error
- func ValidateGenesis(cdc *codec.Codec, genesisState GenesisState) error
- 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
Constants ¶
const ModuleName = "genutil"
Variables ¶
var ModuleCdc *codec.Codec
ModuleCdc defines a generic sealed codec to be used throughout this module
Functions ¶
func DeliverGenTxs ¶
func DeliverGenTxs(ctx sdk.Context, cdc *codec.Codec, genTxs []json.RawMessage, validatorKeeper validator.Keeper, deliverTx deliverTxfn) ([]abci.ValidatorUpdate, error)
DeliverGenTxs - deliver a genesis transaction
func GenesisStateFromGenDoc ¶
func GenesisStateFromGenDoc(cdc *codec.Codec, genDoc tmtypes.GenesisDoc, ) (genesisState map[string]json.RawMessage, err error)
GenesisStateFromGenDoc creates the core parameters for genesis initialization for the application.
NOTE: The pubkey input is this machines pubkey.
func GenesisStateFromGenFile ¶
func GenesisStateFromGenFile(cdc *codec.Codec, genFile string, ) (genesisState map[string]json.RawMessage, genDoc *tmtypes.GenesisDoc, err error)
GenesisStateFromGenFile creates the core parameters for genesis initialization for the application.
NOTE: The pubkey input is this machines pubkey.
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, cdc *codec.Codec, validatorKeeper validator.Keeper, 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, validatorKeeper validator.Keeper, 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 SetGenesisStateInAppState ¶
func SetGenesisStateInAppState(cdc *codec.Codec, appState map[string]json.RawMessage, genesisState GenesisState) map[string]json.RawMessage
SetGenesisStateInAppState sets the genutil genesis state within the expected app state
func ValidateAccountInGenesis ¶
func ValidateAccountInGenesis(appGenesisState map[string]json.RawMessage, genAccIterator types.GenesisAccountsIterator, key sdk.AccAddress, coin sdk.Coin, cdc *codec.Codec) error
ValidateAccountInGenesis checks that the provided key has sufficient coins in the genesis accounts
func ValidateGenesis ¶
func ValidateGenesis(cdc *codec.Codec, genesisState GenesisState) error
ValidateGenesis validates GenTx transactions
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 struct {
GenTxs []json.RawMessage `json:"gentxs" yaml:"gentxs"`
}
GenesisState defines the raw genesis transaction in JSON
func GetGenesisStateFromAppState ¶
func GetGenesisStateFromAppState(cdc *codec.Codec, appState map[string]json.RawMessage) GenesisState
GetGenesisStateFromAppState gets the genutil genesis state from the expected app state
func NewGenesisState ¶
func NewGenesisState(genTxs []json.RawMessage) GenesisState
NewGenesisState creates a new GenesisState object
func NewGenesisStateFromStdTx ¶
func NewGenesisStateFromStdTx(codec *codec.Codec, genTxs []authtypes.StdTx) GenesisState
NewGenesisStateFromStdTx creates a new GenesisState object from auth transactions
type InitConfig ¶
type InitConfig struct { ChainID string GenTxsDir string Name string NodeID string ValPubKey crypto.PubKey }
func NewInitConfig ¶
func NewInitConfig(chainID, genTxsDir, name, nodeID string, valPubKey crypto.PubKey) InitConfig
NewInitConfig creates a new InitConfig object