May 18, 2022

Connext Router Setup

15.05.2022

https://www.connext.network/

ETHEREUM ADDREESS 0x6B52b1284f545DB5ac55988fB4643a1eADa33185

Minimum Hardware Requirements:

  • 8GB RAM
  • 30GB Storage
  • Redis

Official documents:

https://docs.connext.network/routers/spinning-up

Install docker:

sudo apt-get install ca-certificates curl gnupg lsb-release -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io -y

Installing docker-compose

mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
sudo chown $USER /var/run/docker.sock 

Clone the repository

cd ~
git clone https://github.com/connext/nxtp-router-docker-compose.git
cd nxtp-router-docker-compose
git checkout amarok

Environment Config

Create a .env file in the root directory of the repository based on the env.example file.

Modify the following environment variables:

  • ROUTER_VERSION - The version of the router to use (e.g. v0.1.0). See the releases page for the latest released version.
  • ROUTER_EXTERNAL_PORT - Exposed port of the router. Remember to not expose this port to the public.
  • GRAFANA_EXTERNAL_PORT - Exposed port of the Grafana dashboard.
  • LOGDNA_KEY - This key is used by logna container. You can get this key by sign up her
https://www.logdna.com/

Use this commands for preparing your .env file

mv .env.example .env
mv key.example.yaml key.yaml

In the .env file, you must specify the current version (at the time of this writing - 0.2.0-alpha.16, as well as the key logdna.com.

Add your private key to to key.yaml.

Next, you need to register the privatekey of your wallet in the key.yaml file. To do this, export the key in Metamask and place it in the key.yaml file.

Create Router Config

Create a config.json file based on the config.example.json file. At minumum, change the following values:

  • sequencerUrl - The URL of the Sequencer node.
  • redis - The Redis instance to use.
  • server - Internal HTTP server config (adminToken).
  • chains - Add your desired chains, assets, and provider URLs. Use domain mappings instead of chainIds. For more domain ids of chains, please check https://raw.githubusercontent.com/connext/chaindata/main/crossChain.json . Make sure you use multiple providers for each chain! Example with the current testnet assets:
nano config.toml
{
  "chains": {
    "1111": {
      "assets": [
        {
          "address": "0xB7b1d3cC52E658922b2aF00c5729001ceA98142C",
          "name": "TEST"
        }
      ],
      "providers": ["https://eth-rinkeby.alchemyapi.io/v2/Bi4KoxT0rgjHsmVvMRtdY_9rwrTsdY2h", "https://rpc.ankr.com/eth_rinkeby"]
    },
    "2221": {
      "assets": [
        {
          "address": "0xB5AabB55385bfBe31D627E2A717a7B189ddA4F8F",
          "name": "TEST"
        }
      ],
      "providers": ["https://eth-kovan.alchemyapi.io/v2/eEcEgHdAt3fkZkRmzbaI-Sv_1Gw6OxrB"]
    }
  },
  "logLevel": "debug",
  "mnemonic": "",
  "sequencerUrl": "https://sequencer.testnet.connext.ninja",
  "server": { "adminToken": "blahblahblah" },
  "environment": "production"
}


Run docker-compose

docker-compose up -d

Check the logs

docker logs --follow --tail 100 router

Restart docker-compose service

docker-compose restart

If you see this, then everything is fine and you can proceed to the next steps.

Claim test tokens https://amarok-testnet.coinhippo.io/

Go to https://testnet.amarok.connextscan.io/router/<wallet address>

Click manage router and add test tokens on each network.

WOW) You managed to start ROUTER!