Documentation ¶
Index ¶
- type AppManager
- func (am AppManager) BeginBlocker(ctx types.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (am AppManager) EndBlocker(ctx types.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (am AppManager) InitGenesis(ctx types.Context, data map[string]json.RawMessage) abci.ResponseInitChain
- func (am *AppManager) RegisterServices(cfg Configurator)
- type AppModule
- type AppModuleBasic
- type AppModuleGenesis
- type BasicManager
- func (bm BasicManager) DefaultGenesis(validators []tmtypes.GenesisValidator) map[string]json.RawMessage
- func (bm BasicManager) RegisterCodec(cdc *codec.Codec)
- func (bm BasicManager) RegisterGRPCGatewayRoutes(clientCtx client.Context, rtr *runtime.ServeMux)
- func (bm BasicManager) RegisterInterfaces(registry codectypes.InterfaceRegistry)
- type Configurator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppManager ¶
func NewManager ¶
func NewManager(orders []string, modules ...AppModule) *AppManager
func (AppManager) BeginBlocker ¶
func (am AppManager) BeginBlocker(ctx types.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
func (AppManager) EndBlocker ¶
func (am AppManager) EndBlocker(ctx types.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
func (AppManager) InitGenesis ¶
func (am AppManager) InitGenesis(ctx types.Context, data map[string]json.RawMessage) abci.ResponseInitChain
func (*AppManager) RegisterServices ¶
func (am *AppManager) RegisterServices(cfg Configurator)
RegisterServices registers all module services
type AppModule ¶
type AppModule interface { AppModuleGenesis // RegisterServices allows a module to register services RegisterServices(Configurator) }
type AppModuleBasic ¶
type AppModuleBasic interface { Name() string RegisterCodec(codec *codec.Codec) RegisterInterfaces(codectypes.InterfaceRegistry) RegisterGRPCGatewayRoutes(client.Context, *runtime.ServeMux) // 默认的 genesis 配置 DefaultGenesis(validators []tmtypes.GenesisValidator) json.RawMessage }
type AppModuleGenesis ¶
type AppModuleGenesis interface { AppModuleBasic // 根据 genesis 配置初始化 InitGenesis(ctx types.Context, data json.RawMessage) []abci.ValidatorUpdate BeginBlocker(ctx types.Context, req abci.RequestBeginBlock) EndBlock(ctx types.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate }
type BasicManager ¶
type BasicManager map[string]AppModuleBasic
BasicManager
func NewBasicManager ¶
func NewBasicManager(modules ...AppModuleBasic) BasicManager
func (BasicManager) DefaultGenesis ¶
func (bm BasicManager) DefaultGenesis(validators []tmtypes.GenesisValidator) map[string]json.RawMessage
func (BasicManager) RegisterCodec ¶
func (bm BasicManager) RegisterCodec(cdc *codec.Codec)
func (BasicManager) RegisterGRPCGatewayRoutes ¶
func (bm BasicManager) RegisterGRPCGatewayRoutes(clientCtx client.Context, rtr *runtime.ServeMux)
RegisterGRPCGatewayRoutes registers all module rest routes
func (BasicManager) RegisterInterfaces ¶
func (bm BasicManager) RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces registers all module interface types
type Configurator ¶
type Configurator interface { // MsgServer returns a grpc.Server instance which allows registering services // that will handle TxBody.messages in transactions. These Msg's WILL NOT // be exposed as gRPC services. MsgServer() grpc.Server // QueryServer returns a grpc.Server instance which allows registering services // that will be exposed as gRPC services as well as ABCI query handlers. QueryServer() grpc.Server }
Configurator provides the hooks to allow modules to configure and register their services in the RegisterServices method. It is designed to eventually support module object capabilities isolation as described in https://github.com/cosmos/cosmos-sdk/issues/7093
func NewConfigurator ¶
func NewConfigurator(msgServer grpc.Server, queryServer grpc.Server) Configurator
NewConfigurator returns a new Configurator instance
Click to show internal directories.
Click to hide internal directories.