mukan-ibc/docs/versioned_docs/version-v10.1.x/01-ibc/03-apps/06-routing.md
Mukan Erkin Törük 6852832fe8
Some checks failed
CodeQL / Analyze (push) Waiting to run
Docker Build & Push Simapp (main) / docker-build (push) Waiting to run
golangci-lint / lint (push) Waiting to run
Tests / Code Coverage / build (amd64) (push) Waiting to run
Tests / Code Coverage / build (arm64) (push) Waiting to run
Tests / Code Coverage / unit-tests (map[additional-args:-tags="test_e2e" name:e2e path:./e2e]) (push) Waiting to run
Tests / Code Coverage / unit-tests (map[name:08-wasm path:./modules/light-clients/08-wasm]) (push) Waiting to run
Tests / Code Coverage / unit-tests (map[name:ibc-go path:.]) (push) Waiting to run
Deploy to GitHub Pages / Deploy to GitHub Pages (push) Has been cancelled
Buf-Push / push (push) Has been cancelled
initial: sovereign Mukan Network fork
2026-05-11 03:18:28 +03:00

1.1 KiB

title sidebar_label sidebar_position slug
Routing Routing 6 /ibc/apps/routing

Routing

:::note

Pre-requisite readings

::: :::note Synopsis Learn how to hook a route to the IBC router for the custom IBC module. :::

As mentioned above, modules must implement the IBCModule interface (which contains both channel handshake callbacks for IBC classic only, and packet handling callbacks for IBC classic and v2). The concrete implementation of this interface must be registered with the module name as a route on the IBC Router.

// app.go
func NewApp(...args) *App {
  // ...

  // Create static IBC router, add module routes, then set and seal it
  ibcRouter := port.NewRouter()

  ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferModule)
  // Note: moduleCallbacks must implement IBCModule interface
  ibcRouter.AddRoute(moduleName, moduleCallbacks)

  // Setting Router will finalize all routes by sealing router
  // No more routes can be added
  app.IBCKeeper.SetRouter(ibcRouter)

  // ...
}