Documentation ¶
Index ¶
- Constants
- Variables
- func GetMaccPerms() map[string][]string
- func MakeEncodingConfig() params.EncodingConfig
- func SetConfig()
- type CosmosApp
- type GenesisState
- type GitopiaApp
- func (app *GitopiaApp) AppCodec() codec.Codec
- func (app *GitopiaApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *GitopiaApp) BlockedModuleAccountAddrs() map[string]bool
- func (app *GitopiaApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *GitopiaApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error)
- func (app *GitopiaApp) ExportState(ctx sdk.Context) map[string]json.RawMessage
- func (app *GitopiaApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *GitopiaApp) InterfaceRegistry() types.InterfaceRegistry
- func (app *GitopiaApp) LegacyAmino() *codec.LegacyAmino
- func (app *GitopiaApp) LoadHeight(height int64) error
- func (app *GitopiaApp) ModuleAccountAddrs() map[string]bool
- func (app *GitopiaApp) Name() string
- func (app *GitopiaApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *GitopiaApp) RegisterTendermintService(clientCtx client.Context)
- func (app *GitopiaApp) RegisterTxService(clientCtx client.Context)
Constants ¶
const ( AccountAddressPrefix = "gitopia" Name = "gitopia" )
Variables ¶
var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string Upgrades = []upgrades.Upgrade{ { UpgradeName: "v3", CreateUpgradeHandler: upgrades.CreateUpgradeHandler, }, { UpgradeName: "v3.2.0", CreateUpgradeHandler: upgrades.CreateUpgradeHandler, }, { UpgradeName: "v3.3.0", CreateUpgradeHandler: upgrades.CreateUpgradeHandler, }, } )
var ( AccountPubKeyPrefix = AccountAddressPrefix + "pub" ValidatorAddressPrefix = AccountAddressPrefix + "valoper" ValidatorPubKeyPrefix = AccountAddressPrefix + "valoperpub" ConsNodeAddressPrefix = AccountAddressPrefix + "valcons" ConsNodePubKeyPrefix = AccountAddressPrefix + "valconspub" )
var ModuleBasics = module.NewBasicManager( auth.AppModuleBasic{}, genutil.AppModuleBasic{}, bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( []govclient.ProposalHandler{ paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler, ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler, }, ), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, authzmodule.AppModuleBasic{}, groupmodule.AppModuleBasic{}, ibc.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, gitopia.AppModule{}, rewards.AppModule{}, )
ModuleBasics defines the module BasicManager is in charge of setting up basic, non-dependant module elements, such as codec registration and genesis verification.
Functions ¶
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
func MakeEncodingConfig ¶
func MakeEncodingConfig() params.EncodingConfig
MakeEncodingConfig creates an EncodingConfig for testing
Types ¶
type CosmosApp ¶
type CosmosApp interface { // The assigned name of the app. Name() string // The application types codec. // NOTE: This shoult be sealed before being returned. LegacyAmino() *codec.LegacyAmino // Application updates every begin block. BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock // Application updates every end block. EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock // Application update at chain (i.e app) initialization. InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain // Loads the app at a given height. LoadHeight(height int64) error // Exports the state of the application for a genesis file. ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (types.ExportedApp, error) // All the registered module account addreses. ModuleAccountAddrs() map[string]bool }
App implements the common methods for a Cosmos SDK-based application specific blockchain.
type GenesisState ¶
type GenesisState map[string]json.RawMessage
The genesis state of the blockchain is represented here as a map of raw json messages key'd by a identifier string. The identifier 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(cdc codec.JSONCodec) GenesisState
NewDefaultGenesisState generates the default state for the application.
type GitopiaApp ¶
type GitopiaApp struct { *baseapp.BaseApp keepers.AppKeepers // 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 NewGitopiaApp ¶
func NewGitopiaApp( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, encodingConfig gitopiaappparams.EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *GitopiaApp
NewGitopia returns a reference to an initialized Gaia.
func SetupTestingAppWithLevelDb ¶
func SetupTestingAppWithLevelDb(isCheckTx bool) (app *GitopiaApp, cleanupFn func())
SetupTestingAppWithLevelDb initializes a new GitopiaApp intended for testing, with LevelDB as a db.
func (*GitopiaApp) AppCodec ¶
func (app *GitopiaApp) AppCodec() codec.Codec
AppCodec returns Gaia's app codec.
NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.
func (*GitopiaApp) BeginBlocker ¶
func (app *GitopiaApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
BeginBlocker application updates every begin block
func (*GitopiaApp) BlockedModuleAccountAddrs ¶
func (app *GitopiaApp) BlockedModuleAccountAddrs() map[string]bool
BlockedModuleAccountAddrs returns all the app's blocked module account addresses.
func (*GitopiaApp) EndBlocker ¶
func (app *GitopiaApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
EndBlocker application updates every end block
func (*GitopiaApp) ExportAppStateAndValidators ¶
func (app *GitopiaApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*GitopiaApp) ExportState ¶
func (app *GitopiaApp) ExportState(ctx sdk.Context) map[string]json.RawMessage
func (*GitopiaApp) InitChainer ¶
func (app *GitopiaApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
InitChainer application update at chain initialization
func (*GitopiaApp) InterfaceRegistry ¶
func (app *GitopiaApp) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns Gaia's InterfaceRegistry
func (*GitopiaApp) LegacyAmino ¶
func (app *GitopiaApp) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns SimApp's amino codec.
NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.
func (*GitopiaApp) LoadHeight ¶
func (app *GitopiaApp) LoadHeight(height int64) error
LoadHeight loads a particular height
func (*GitopiaApp) ModuleAccountAddrs ¶
func (app *GitopiaApp) ModuleAccountAddrs() map[string]bool
ModuleAccountAddrs returns all the app's module account addresses.
func (*GitopiaApp) RegisterAPIRoutes ¶
func (app *GitopiaApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*GitopiaApp) RegisterTendermintService ¶
func (app *GitopiaApp) RegisterTendermintService(clientCtx client.Context)
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*GitopiaApp) RegisterTxService ¶
func (app *GitopiaApp) RegisterTxService(clientCtx client.Context)
RegisterTxService implements the Application.RegisterTxService method.