Skip to main content
This document provides instructions on integrating and configuring the Packet Forward Middleware (PFM) within your existing chain implementation. The integration steps include the following:
  1. Import the PFM, initialize the PFM Module & Keeper, initialize the store keys, and initialize the Begin/End Block logic and InitGenesis order
  2. Configure the IBC application stack including the transfer module
  3. Configuration of additional options such as timeout period and number of retries on timeout
Integration of the PFM should take approximately 20 minutes.

Example integration of the Packet Forward Middleware

Configuring the transfer application stack with Packet Forward Middleware

Here is an example of how to create an application stack using transfer and packet-forward-middleware. The following transferStack is configured in app/app.go and added to the IBC Router. The in-line comments describe the execution flow of packets between the application stack and IBC core. For more information on configuring an IBC application stack see the middleware development guide.

Configurable options in the Packet Forward Middleware

The Packet Forward Middleware has several configurable options available when initializing the IBC application stack. You can see these passed in as arguments to packetforward.NewIBCMiddleware and they include the number of retries that will be performed on a forward timeout, and the timeout period that will be used for a forward.
  • Retries On Timeout - how many times will a forward be re-attempted in the case of a timeout.
  • Timeout Period - how long can a forward be in progress before giving up.