How to Initialize a Router on the Connext Network

Harrison Schick
3 min readMar 16, 2023

--

Designed to be used in conjunction with our Connext Router Setup Guide.

⚠ Please disregard this guide if you aren’t setting up a Connext router ⚠

Getting Started

Before you can operate a Router (Node) on the Connext network, you will need to call the initializeRouter function on-chain so that it can be added to the Connext Core Contract for each chain that you plan to provide liquidity — see reference. This guide will teach you how to use louper.dev to call this function and complete router initialization.

Before initializing your router on mainnet, make sure that you are properly whitelisted. As of recently, routers do not need to be whitelisted for operation on the testnet, only mainnet.

It is important to be aware that you will need to initialize your router on each chain that you plan to provide liquidity. If you fail to initialize your router on a chain, and supply liquidity, the funds will not be utilized.

Initialize on a Single Chain

⚠️ Repeat the following steps for each chain that you plan to provide liquidity.

As stated before, we are interacting with the Connext Core smart contract when we are initializing the router. Although one is currently under-development, Connext does not offer a user interface (UI) for initializing your router. We’ve found that the easiest way to do so is by using louper.dev.

To initialize your router, you should first click on one of the following contract links for louper.dev corresponding to the network that you would like to initialize on

Testnet — Connext Core Contracts Louper.dev:

Mainnet — Connext Core Contracts Louper.dev:

Now that you’ve selected the chain to initialize on, scroll down and locate the RoutersFacet contract. Click WRITE at the bottom of the contract card.

⚠️WARNING⚠️ The connected wallet needs to be the router’s wallet, as the msg.sender in the smart contract is initialized as the router on the Connext network.

On the next page, connect using your router’s wallet, and select the initializeRouter method. The required parameters are described as follows:

  • _owner: The address that is able to set and change the _recipient address, or set a new _owner address.
  • _recipient: The address that will receive funds when liquidity is removed.

Before executing this method, it’s important to understand the permissions for the different roles governing Connext routers. See the table below for reference.

Connext Router Roles — Table Breakdown

If you would like to use your router’s wallet to fully manage the router and funds, you should set both of these parameters to the router wallet. Click EXECUTE when you are satisfied with the passed parameters.

You can read more about the router recipient and the router owner on Managing your Router. If you’d like to change the recipient or owner address for your router, see Initialize a Router.

Note: If you’d like to change the _owner or _recipient address in the future, you can call the function again — but only the currently set _owner has the ability to set a new owner or recipient.

Conclusion

After verifying that you’ve initialized the router on all of the networks that you plan to provide liquidity on, you can head back to the main guide:

📱 Questions & Contact

Congratulations on completing this guide! If you need to get in touch with the author of this guide, please contact me on Telegram:

https://t.me/hschickdevs

--

--

Harrison Schick

Graduate Student at UT Austin ▪️ Exploring Technical Innovation in TradFi & DeFi ▪️ Find me on GitHub: https://github.com/hschickdevs