Documentation
¶
Index ¶
- Constants
- func KVStoreAdapter(store store.KVStore) storetypes.KVStore
- func NewEnvironment(kvService store.KVStoreService, logger log.Logger, opts ...EnvOption) appmodule.Environment
- func NewEventManager(ctx context.Context) event.Manager
- func NewKVStoreService(storeKey *storetypes.KVStoreKey) store.KVStoreService
- func NewMemStoreService(storeKey *storetypes.MemoryStoreKey) store.MemoryStoreService
- func NewMsgRouterService(msgRouter baseapp.MessageRouter) router.Service
- func NewQueryRouterService(queryRouter baseapp.QueryRouter) router.Service
- func NewTransientStoreService(storeKey *storetypes.TransientStoreKey) store.TransientStoreService
- func ProvideCometService() comet.Service
- func ProvideEnvironment(logger log.Logger, config *runtimev1alpha1.Module, key depinject.ModuleKey, ...) (store.KVStoreService, store.MemoryStoreService, appmodule.Environment)
- func ProvideGenesisTxHandler(appBuilder *AppBuilder) genutil.TxHandler
- func ProvideKVStoreFactory(app *AppBuilder) store.KVStoreServiceFactory
- func ProvideKVStoreKey(config *runtimev1alpha1.Module, key depinject.ModuleKey, app *AppBuilder) *storetypes.KVStoreKey
- func ProvideMemoryStoreKey(config *runtimev1alpha1.Module, key depinject.ModuleKey, app *AppBuilder) *storetypes.MemoryStoreKey
- func ProvideModuleManager(modules map[string]appmodule.AppModule) *module.Manager
- func ProvideModuleScopedConfigMap(key depinject.ModuleKey, moduleConfigs ModuleConfigMaps) server.ConfigMap
- func ProvideTransientStoreKey(config *runtimev1alpha1.Module, key depinject.ModuleKey, app *AppBuilder) *storetypes.TransientStoreKey
- func ProvideTransientStoreService(config *runtimev1alpha1.Module, key depinject.ModuleKey, app *AppBuilder) store.TransientStoreService
- func SetupAppBuilder(inputs AppInputs)
- func UpgradeStoreLoader(upgradeHeight int64, storeUpgrades *store.StoreUpgrades) baseapp.StoreLoader
- type App
- func (a *App) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
- func (a *App) Close() error
- func (a *App) Configurator() module.Configurator
- func (a *App) DefaultGenesis() map[string]json.RawMessage
- func (a *App) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)
- func (a *App) GetKey(storeKey string) *storetypes.KVStoreKey
- func (a *App) GetStoreKeys() []storetypes.StoreKey
- func (a *App) InitChainer(ctx sdk.Context, req *abci.InitChainRequest) (*abci.InitChainResponse, error)
- func (a *App) Load(loadLatest bool) error
- func (a *App) LoadHeight(height int64) error
- func (a *App) PreBlocker(ctx sdk.Context, _ *abci.FinalizeBlockRequest) error
- func (a *App) Precommiter(ctx sdk.Context)
- func (a *App) PrepareCheckStater(ctx sdk.Context)
- func (a *App) RegisterModules(modules ...module.AppModule) error
- func (a *App) RegisterStores(keys ...storetypes.StoreKey) error
- func (a *App) RegisterTxService(clientCtx client.Context)
- func (a *App) SetInitChainer(initChainer sdk.InitChainer)
- func (a *App) UnsafeFindStoreKey(storeKey string) storetypes.StoreKey
- func (a *App) ValidatorKeyProvider() KeyGenF
- type AppBuilder
- type AppI
- type AppInputs
- type AppSimI
- type BaseAppOption
- type BranchService
- type ContextAwareCometInfoService
- type CoreGasmeter
- type EnvOption
- type EventService
- type Events
- type ExportedApp
- type GasConfig
- func (gc GasConfig) DeleteCost() gas.Gas
- func (gc GasConfig) HasCost() gas.Gas
- func (gc GasConfig) IterNextCostFlat() gas.Gas
- func (gc GasConfig) ReadCostFlat() gas.Gas
- func (gc GasConfig) ReadCostPerByte() gas.Gas
- func (gc GasConfig) WriteCostFlat() gas.Gas
- func (gc GasConfig) WriteCostPerByte() gas.Gas
- type GasService
- type HeaderService
- type KeyGenF
- type ModuleConfigMaps
- type ModuleConfigMapsInput
- type TransactionService
Constants ¶
const ModuleName = "runtime"
Variables ¶
This section is empty.
Functions ¶
func KVStoreAdapter ¶
func KVStoreAdapter(store store.KVStore) storetypes.KVStore
func NewEnvironment ¶
func NewEnvironment( kvService store.KVStoreService, logger log.Logger, opts ...EnvOption, ) appmodule.Environment
NewEnvironment creates a new environment for the application For setting custom services that aren't set by default, use the EnvOption Note: Depinject always provide an environment with all services (mandatory and optional)
func NewKVStoreService ¶
func NewKVStoreService(storeKey *storetypes.KVStoreKey) store.KVStoreService
func NewMemStoreService ¶
func NewMemStoreService(storeKey *storetypes.MemoryStoreKey) store.MemoryStoreService
func NewMsgRouterService ¶
func NewMsgRouterService(msgRouter baseapp.MessageRouter) router.Service
NewMsgRouterService return new implementation of router.Service.
func NewQueryRouterService ¶
func NewQueryRouterService(queryRouter baseapp.QueryRouter) router.Service
NewQueryRouterService return new implementation of router.Service.
func NewTransientStoreService ¶
func NewTransientStoreService(storeKey *storetypes.TransientStoreKey) store.TransientStoreService
func ProvideCometService ¶
func ProvideEnvironment ¶
func ProvideEnvironment( logger log.Logger, config *runtimev1alpha1.Module, key depinject.ModuleKey, app *AppBuilder, msgServiceRouter *baseapp.MsgServiceRouter, queryServiceRouter *baseapp.GRPCQueryRouter, ) (store.KVStoreService, store.MemoryStoreService, appmodule.Environment)
func ProvideGenesisTxHandler ¶
func ProvideGenesisTxHandler(appBuilder *AppBuilder) genutil.TxHandler
func ProvideKVStoreFactory ¶
func ProvideKVStoreFactory(app *AppBuilder) store.KVStoreServiceFactory
func ProvideKVStoreKey ¶
func ProvideKVStoreKey( config *runtimev1alpha1.Module, key depinject.ModuleKey, app *AppBuilder, ) *storetypes.KVStoreKey
func ProvideMemoryStoreKey ¶
func ProvideMemoryStoreKey( config *runtimev1alpha1.Module, key depinject.ModuleKey, app *AppBuilder, ) *storetypes.MemoryStoreKey
func ProvideModuleManager ¶
func ProvideModuleScopedConfigMap ¶
func ProvideModuleScopedConfigMap( key depinject.ModuleKey, moduleConfigs ModuleConfigMaps, ) server.ConfigMap
func ProvideTransientStoreKey ¶
func ProvideTransientStoreKey( config *runtimev1alpha1.Module, key depinject.ModuleKey, app *AppBuilder, ) *storetypes.TransientStoreKey
func ProvideTransientStoreService ¶
func ProvideTransientStoreService( config *runtimev1alpha1.Module, key depinject.ModuleKey, app *AppBuilder, ) store.TransientStoreService
func SetupAppBuilder ¶
func SetupAppBuilder(inputs AppInputs)
func UpgradeStoreLoader ¶
func UpgradeStoreLoader(upgradeHeight int64, storeUpgrades *store.StoreUpgrades) baseapp.StoreLoader
UpgradeStoreLoader is used to prepare baseapp with a fixed StoreLoader pattern. This is useful for custom upgrade loading logic.
Types ¶
type App ¶
type App struct { *baseapp.BaseApp ModuleManager *module.Manager UnorderedTxManager *unorderedtx.Manager // contains filtered or unexported fields }
App is a wrapper around BaseApp and ModuleManager that can be used in hybrid app.go/app config scenarios or directly as a servertypes.Application instance. To get an instance of *App, *AppBuilder must be requested as a dependency in a container which declares the runtime module and the AppBuilder.Build() method must be called.
App can be used to create a hybrid app.go setup where some configuration is done declaratively with an app config and the rest of it is done the old way. See simapp/app.go for an example of this setup.
func (*App) BeginBlocker ¶
BeginBlocker application updates every begin block
func (*App) Close ¶
Close closes all necessary application resources. It implements servertypes.Application.
func (*App) Configurator ¶
func (a *App) Configurator() module.Configurator
Configurator returns the app's configurator.
func (*App) DefaultGenesis ¶
func (a *App) DefaultGenesis() map[string]json.RawMessage
DefaultGenesis returns a default genesis from the registered AppModule's.
func (*App) EndBlocker ¶
EndBlocker application updates every end block
func (*App) GetKey ¶
func (a *App) GetKey(storeKey string) *storetypes.KVStoreKey
GetKey returns the KVStoreKey for the provided store key.
NOTE: This should only be used in testing.
func (*App) GetStoreKeys ¶
func (a *App) GetStoreKeys() []storetypes.StoreKey
GetStoreKeys returns all the stored store keys.
func (*App) InitChainer ¶
func (a *App) InitChainer(ctx sdk.Context, req *abci.InitChainRequest) (*abci.InitChainResponse, error)
InitChainer initializes the chain.
func (*App) LoadHeight ¶
LoadHeight loads a particular height
func (*App) PreBlocker ¶
PreBlocker application updates every pre block
func (*App) Precommiter ¶
Precommiter application updates every commit
func (*App) PrepareCheckStater ¶
PrepareCheckStater application updates every commit
func (*App) RegisterModules ¶
RegisterModules registers the provided modules with the module manager and the basic module manager. This is the primary hook for integrating with modules which are not registered using the app config.
func (*App) RegisterStores ¶
func (a *App) RegisterStores(keys ...storetypes.StoreKey) error
RegisterStores registers the provided store keys. This method should only be used for registering extra stores which is necessary for modules that not registered using the app config. To be used in combination of RegisterModules.
func (*App) RegisterTxService ¶
RegisterTxService implements the Application.RegisterTxService method.
func (*App) SetInitChainer ¶
func (a *App) SetInitChainer(initChainer sdk.InitChainer)
SetInitChainer sets the init chainer function It wraps `BaseApp.SetInitChainer` to allow setting a custom init chainer from an app.
func (*App) UnsafeFindStoreKey ¶
func (a *App) UnsafeFindStoreKey(storeKey string) storetypes.StoreKey
UnsafeFindStoreKey fetches a registered StoreKey from the App in linear time.
NOTE: This should only be used in testing.
func (*App) ValidatorKeyProvider ¶
ValidatorKeyProvider returns a function that generates a private key for use by comet.
type AppBuilder ¶
type AppBuilder struct {
// contains filtered or unexported fields
}
AppBuilder is a type that is injected into a container by the runtime module (as *AppBuilder) which can be used to create an app which is compatible with the existing app.go initialization conventions.
func ProvideApp ¶
func ProvideApp( interfaceRegistry codectypes.InterfaceRegistry, amino registry.AminoRegistrar, protoCodec *codec.ProtoCodec, ) ( *AppBuilder, *baseapp.MsgServiceRouter, *baseapp.GRPCQueryRouter, appmodule.AppModule, protodesc.Resolver, protoregistry.MessageTypeResolver, )
func (*AppBuilder) Build ¶
func (a *AppBuilder) Build(db corestore.KVStoreWithBatch, traceStore io.Writer, baseAppOptions ...func(*baseapp.BaseApp)) *App
Build builds an *App instance.
func (*AppBuilder) DefaultGenesis ¶
func (a *AppBuilder) DefaultGenesis() map[string]json.RawMessage
DefaultGenesis returns a default genesis from the registered modules.
type AppI ¶
type AppI interface { // Name the assigned name of the app. Name() string // BeginBlocker updates every begin block. BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) // EndBlocker updates every end block. EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) // InitChainer update at chain (i.e app) initialization. InitChainer(ctx sdk.Context, req *abci.InitChainRequest) (*abci.InitChainResponse, error) // LoadHeight load 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, modulesToExport []string) (ExportedApp, error) }
AppI implements the common methods for a Cosmos SDK-based application specific blockchain.
type AppInputs ¶
type AppInputs struct { depinject.In Logger log.Logger Config *runtimev1alpha1.Module AppBuilder *AppBuilder ModuleManager *module.Manager BaseAppOptions []BaseAppOption InterfaceRegistry codectypes.InterfaceRegistry LegacyAmino registry.AminoRegistrar AppOptions server.DynamicConfig `optional:"true"` // can be nil in client wiring }
type AppSimI ¶
type AppSimI interface { AppI // SimulationManager helper for the simulation framework. SimulationManager() *module.SimulationManager }
AppSimI implements the common methods for a Cosmos SDK-based application specific blockchain that chooses to utilize the sdk simulation framework.
type BaseAppOption ¶
BaseAppOption is a depinject.AutoGroupType which can be used to pass BaseApp options into the depinject. It should be used carefully.
func (BaseAppOption) IsManyPerContainerType ¶
func (b BaseAppOption) IsManyPerContainerType()
IsManyPerContainerType indicates that this is a depinject.ManyPerContainerType.
type ContextAwareCometInfoService ¶
type ContextAwareCometInfoService struct{}
ContextAwareCometInfoService provides CometInfo which is embedded as a value in a Context. This the legacy (server v1, baseapp) way of accessing CometInfo at the module level.
func NewContextAwareCometInfoService ¶
func NewContextAwareCometInfoService() *ContextAwareCometInfoService
type CoreGasmeter ¶
type CoreGasmeter struct {
// contains filtered or unexported fields
}
CoreGasmeter is a wrapper around the SDK's GasMeter that implements the GasMeter interface.
func (CoreGasmeter) Consume ¶
func (cgm CoreGasmeter) Consume(amount gas.Gas, descriptor string) error
func (CoreGasmeter) Consumed ¶
func (cgm CoreGasmeter) Consumed() gas.Gas
func (CoreGasmeter) Limit ¶
func (cgm CoreGasmeter) Limit() gas.Gas
func (CoreGasmeter) Refund ¶
func (cgm CoreGasmeter) Refund(amount gas.Gas, descriptor string) error
func (CoreGasmeter) Remaining ¶
func (cgm CoreGasmeter) Remaining() gas.Gas
type EnvOption ¶
type EnvOption func(*appmodule.Environment)
func EnvWithMemStoreService ¶
func EnvWithMemStoreService(memStoreService store.MemoryStoreService) EnvOption
func EnvWithMsgRouterService ¶
func EnvWithMsgRouterService(msgServiceRouter *baseapp.MsgServiceRouter) EnvOption
func EnvWithQueryRouterService ¶
func EnvWithQueryRouterService(queryServiceRouter *baseapp.GRPCQueryRouter) EnvOption
type EventService ¶
type EventService struct {
Events
}
func (EventService) EventManager ¶
func (es EventService) EventManager(ctx context.Context) event.Manager
type Events ¶
type Events struct {
sdk.EventManagerI
}
type ExportedApp ¶
type ExportedApp struct { // AppState is the application state as JSON. AppState json.RawMessage // Validators is the exported validator set. Validators []sdk.GenesisValidator // Height is the app's latest block height. Height int64 // ConsensusParams are the exported consensus params for ABCI. ConsensusParams cmtproto.ConsensusParams }
ExportedApp represents an exported app state, along with validators, consensus params and latest app height.
type GasConfig ¶
type GasConfig struct {
// contains filtered or unexported fields
}
func (GasConfig) DeleteCost ¶
func (GasConfig) IterNextCostFlat ¶
func (GasConfig) ReadCostFlat ¶
func (GasConfig) ReadCostPerByte ¶
func (GasConfig) WriteCostFlat ¶
func (GasConfig) WriteCostPerByte ¶
type GasService ¶
type GasService struct{}
func (GasService) BlockGasMeter ¶
func (g GasService) BlockGasMeter(ctx context.Context) gas.Meter
type HeaderService ¶
type HeaderService struct{}
func (HeaderService) HeaderInfo ¶
func (h HeaderService) HeaderInfo(ctx context.Context) header.Info
type ModuleConfigMaps ¶
ModuleConfigMaps is a map module scoped ConfigMaps
func ProvideModuleConfigMaps ¶
func ProvideModuleConfigMaps(in ModuleConfigMapsInput) ModuleConfigMaps
ProvideModuleConfigMaps returns a map of module name to module config map. The module config map is a map of flag to value.
type ModuleConfigMapsInput ¶
type ModuleConfigMapsInput struct { depinject.In ModuleConfigs []server.ModuleConfigMap DynamicConfig server.DynamicConfig `optional:"true"` }
type TransactionService ¶
type TransactionService struct{}
func (TransactionService) ExecMode ¶
func (t TransactionService) ExecMode(ctx context.Context) transaction.ExecMode
ExecMode implements transaction.Service.