README
¶
Mesh security provider
Cosmos module implementation
Integrate the mesh security provider module
Prerequisites
Projects that want to integrate the meshsecurityprovider module onto their Cosmos SDK chain must enable the following modules:
Configuring and Adding Module
-
Add the mesh security package to the go.mod and install it.
require ( ... github.com/osmosis-labs/mesh-security ... )
-
Add the following modules to
app.go
import ( ... meshsecprov "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurityprovider" meshsecprovkeeper "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurityprovider/keeper" meshsecprovtypes "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurityprovider/types" ... )
-
In
app.go
: Register the AppModule for the mesh security provider module.ModuleBasics = module.NewBasicManager( ... meshsecprov.AppModuleBasic{}, ... )
-
In
app.go
: Add mesh security provider keeper.type App struct { ... MeshSecProvKeeper *meshsecprovkeeper.Keeper ... }
-
In
app.go
: Add mesh security provider store key.keys := sdk.NewKVStoreKeys( ... meshsecprovtypes.StoreKey, ... )
-
In
app.go
: Instantiate mesh security provider keeperapp.MeshSecProvKeeper = meshsecprovkeeper.NewKeeper( appCodec, keys[meshsecprovtypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String(), app.BankKeeper, &app.WasmKeeper, app.StakingKeeper, )
-
In
app.go
: Add the mesh security provider module to the app manager instantiation.app.mm = module.NewManager( ... meshsecprov.NewAppModule(app.MeshSecProvKeeper) ... )
-
In
app.go
: Add the module as the final element to the following:
- SetOrderBeginBlockers
- SetOrderEndBlockers
- SetOrderInitGenesis
// Add mesh security to begin blocker logic app.moduleManager.SetOrderBeginBlockers( ... meshsecprovtypes.ModuleName, ... ) // Add mesh security to end blocker logic app.moduleManager.SetOrderEndBlockers( ... meshsecprovtypes.ModuleName, ... ) // Add mesh security to init genesis logic app.moduleManager.SetOrderInitGenesis( ... meshsecprovtypes.ModuleName, ... )
- In
app.go
: Add the mesh security wasm message handler decorator to the wasm module.meshMessageHandler := wasmkeeper.WithMessageHandlerDecorator(func(nested wasmkeeper.Messenger) wasmkeeper.Messenger { return wasmkeeper.NewMessageHandlerChain( meshsecprovkeeper.CustomMessageDecorator(app.MeshSecProvKeeper), nested, ) }) wasmOpts = append(wasmOpts, meshMessageHandler)
Documentation
¶
Index ¶
- type AppModule
- func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
- func (AppModule) ConsensusVersion() uint64
- func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) QuerierRoute() string
- func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
- func (am AppModule) RegisterServices(cfg module.Configurator)
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
- func (b AppModuleBasic) GetQueryCmd() *cobra.Command
- func (b AppModuleBasic) GetTxCmd() *cobra.Command
- func (AppModuleBasic) Name() string
- func (b AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
- func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
func NewAppModule ¶
func (AppModule) BeginBlock ¶
func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
BeginBlock performs TODO.
func (AppModule) ConsensusVersion ¶
ConsensusVersion implements AppModule/ConsensusVersion.
func (AppModule) EndBlock ¶
func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock performs TODO.
func (AppModule) ExportGenesis ¶
ExportGenesis returns the exported genesis state as raw bytes for the meshsecurity provider. module.
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate
InitGenesis performs genesis initialization for the meshsecurity provider module. no validator updates.
func (AppModule) QuerierRoute ¶
QuerierRoute returns the meshsecurity provider module's querier route name.
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
func (AppModule) RegisterServices ¶
func (am AppModule) RegisterServices(cfg module.Configurator)
type AppModuleBasic ¶
type AppModuleBasic struct{}
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
func (AppModuleBasic) GetQueryCmd ¶
func (b AppModuleBasic) GetQueryCmd() *cobra.Command
func (AppModuleBasic) GetTxCmd ¶
func (b AppModuleBasic) GetTxCmd() *cobra.Command
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
func (AppModuleBasic) RegisterGRPCGatewayRoutes ¶
func (b AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
--------------------------------------- Interfaces.
func (AppModuleBasic) RegisterInterfaces ¶
func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces registers interfaces and implementations of the meshsecurity provider module.
func (AppModuleBasic) RegisterLegacyAminoCodec ¶
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error
ValidateGenesis performs genesis state validation for the meshsecurity provider module.