module

package
v1.5.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2021 License: Apache-2.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppManager

type AppManager struct {
	Modules map[string]AppModule
	Orders  []string
}

func NewManager

func NewManager(orders []string, modules ...AppModule) *AppManager

func (AppManager) BeginBlocker

func (AppManager) EndBlocker

func (*AppManager) ExportGenesis added in v1.5.23

func (am *AppManager) ExportGenesis(ctx types.Context) map[string]json.RawMessage

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
	ExportGenesis(types.Context) json.RawMessage
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL