Documentation ¶
Index ¶
- Constants
- Variables
- func GetMaccPerms() map[string][]string
- func MakeEncodingConfig() params.EncodingConfig
- func NewAnteHandler(ak authante.AccountKeeper, bankKeeper authtypes.BankKeeper, ...) sdk.AnteHandler
- func RegisterSwaggerAPI(ctx client.Context, rtr *mux.Router)
- func SetConfig()
- type App
- func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error)
- func (app *App) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *App) LegacyAmino() *codec.LegacyAmino
- func (app *App) LoadHeight(height int64) error
- func (app *App) ModuleAccountAddrs() map[string]bool
- func (app *App) Name() string
- func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *App) RegisterTendermintService(clientCtx client.Context)
- func (app *App) RegisterTxService(clientCtx client.Context)
- type CosmosApp
- type GenesisState
Constants ¶
const (
// AccountAddressPrefix default account prefix for the address in the chain
AccountAddressPrefix = "cosmos"
)
Variables ¶
var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome = func(appName string) string { return os.ExpandEnv("$HOME/.cosmoscash") } // ModuleBasics defines the module BasicManager is in charge of setting up basic, // non-dependant module elements, such as codec registration // and genesis verification. ModuleBasics = module.NewBasicManager( auth.AppModuleBasic{}, genutil.AppModuleBasic{}, bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler, ), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, ibc.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, liquidity.AppModuleBasic{}, issuer.AppModuleBasic{}, vcs.AppModuleBasic{}, did.AppModuleBasic{}, ) )
var ( AccountPubKeyPrefix = AccountAddressPrefix + "pub" ValidatorAddressPrefix = AccountAddressPrefix + "valoper" ValidatorPubKeyPrefix = AccountAddressPrefix + "valoperpub" ConsNodeAddressPrefix = AccountAddressPrefix + "valcons" ConsNodePubKeyPrefix = AccountAddressPrefix + "valconspub" )
Various prefixes for accounts and public keys
Functions ¶
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
func MakeEncodingConfig ¶
func MakeEncodingConfig() params.EncodingConfig
MakeEncodingConfig creates an EncodingConfig for testing
func NewAnteHandler ¶
func NewAnteHandler( ak authante.AccountKeeper, bankKeeper authtypes.BankKeeper, ik issuerkeeper.Keeper, dk didkeeper.Keeper, vcsk vcskeeper.Keeper, sigGasConsumer authante.SignatureVerificationGasConsumer, signModeHandler signing.SignModeHandler, ) sdk.AnteHandler
NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures & account numbers, and deducts fees from the first signer.
func RegisterSwaggerAPI ¶ added in v1.0.0
RegisterSwaggerAPI registers swagger route with API Server
Types ¶
type App ¶
type App struct { *baseapp.BaseApp // keepers AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper CapabilityKeeper *capabilitykeeper.Keeper StakingKeeper stakingkeeper.Keeper SlashingKeeper slashingkeeper.Keeper MintKeeper mintkeeper.Keeper DistrKeeper distrkeeper.Keeper GovKeeper govkeeper.Keeper CrisisKeeper crisiskeeper.Keeper UpgradeKeeper upgradekeeper.Keeper ParamsKeeper paramskeeper.Keeper IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly EvidenceKeeper evidencekeeper.Keeper TransferKeeper ibctransferkeeper.Keeper LiquidityKeeper liquiditykeeper.Keeper // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper ScopedTransferKeeper capabilitykeeper.ScopedKeeper // this line is used by starport scaffolding # stargate/app/keeperDeclaration IssuerKeeper issuerkeeper.Keeper VcsKeeper vcskeeper.Keeper DidDocumentKeeper didkeeper.Keeper // contains filtered or unexported fields }
App extends an ABCI application, but with most of its parameters exported. They are exported for convenience in creating helper functions, as object capabilities aren't needed for testing.
func New ¶
func New( appName string, logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, encodingConfig appparams.EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *App
New returns a reference to an initialized Gaia. NewSimApp returns a reference to an initialized SimApp.
func (*App) BeginBlocker ¶
func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
BeginBlocker application updates every begin block
func (*App) EndBlocker ¶
func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
EndBlocker application updates every end block
func (*App) ExportAppStateAndValidators ¶
func (app *App) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*App) GetSubspace ¶
func (app *App) GetSubspace(moduleName string) paramstypes.Subspace
GetSubspace returns a param subspace for a given module name.
func (*App) InitChainer ¶
func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
InitChainer application update at chain initialization
func (*App) LegacyAmino ¶
func (app *App) LegacyAmino() *codec.LegacyAmino
nolint LegacyAmino returns SimApp's amino codec.
func (*App) LoadHeight ¶
LoadHeight loads a particular height
func (*App) ModuleAccountAddrs ¶
ModuleAccountAddrs returns all the app's module account addresses.
func (*App) RegisterAPIRoutes ¶
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*App) RegisterTendermintService ¶
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*App) RegisterTxService ¶
RegisterTxService implements the Application.RegisterTxService method.
type CosmosApp ¶
type CosmosApp interface { // Name return the assigned name of the app. Name() string //nolint // LegacyAmino returns the legacy amino coded // NOTE: This should be sealed before being returned. LegacyAmino() *codec.LegacyAmino // BeginBlocker Application updates every begin block. BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock // EndBlocker Application updates every end block. EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock // InitChainer Application update at chain (i.e app) initialization. InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain // LoadHeight Loads the app at a given height. LoadHeight(height int64) error // ExportAppStateAndValidators Exports the state of the application for a genesis file. ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (types.ExportedApp, error) // ModuleAccountAddrs All the registered module account addresses. ModuleAccountAddrs() map[string]bool }
CosmosApp implements the common methods for a Cosmos SDK-based application specific blockchain.
type GenesisState ¶
type GenesisState map[string]json.RawMessage
GenesisState The genesis state of the blockchain is represented here as a map of raw json messages indexed by a did string. The did is used to determine which module genesis information belongs to so it may be appropriately routed during init chain. Within this application default genesis information is retrieved from the ModuleBasicManager which populates json from each BasicModule object provided to it during init.
func NewDefaultGenesisState ¶
func NewDefaultGenesisState() GenesisState
NewDefaultGenesisState generates the default state for the application.