Higher than v0.50

Integrating the Avalanche Light-Client Module in Your Cosmos SDK Application

Enhance your Cosmos SDK application by integrating the light-clients/14-avalanche module. Follow this step-by-step guide to easily import and register the Avalanche light-client in your project.

1. Import the Avalanche Light-Client Module

First, ensure you import the Avalanche (ava) module into your Cosmos SDK application. Typically, this is done in the ibc.go file, where your application's modules are defined.

import (
  // other imports...
  ava "github.com/cosmos/ibc-go/v8/modules/light-clients/14-avalanche"
)

2. Register the Avalanche Module in the Module Manager

Next, add the ava module to your application’s ModuleManager. Locate the section where you initialize the ModuleManager and include the Avalanche light-client:

app.ModuleManager = module.NewManager(
  // other modules...
  ava.AppModuleBasic{},
)

3. Add module to the RegisterIBC function

Finally, register the Avalanche module in the RegisterIBC function of your application. This function is typically found in the ibc.go file.

func RegisterIBC(registry cdctypes.InterfaceRegistry) map[string]appmodule.AppModule {
	modules := map[string]appmodule.AppModule{
        // other modules... 
        ava.ModuleName: ava.AppModuleBasic{},
    }
...
}

By following these steps, you'll successfully integrate the Avalanche light-client module into your Cosmos SDK application, enabling enhanced interoperability with Avalanche-based chains.

Last updated

Logo

Β©2024 Gaia Labs LTD