# Connext Router Setup

By [cyberG|DVS](https://paragraph.com/@cyberg) · 2022-05-15

---

![https://www.connext.network/](https://storage.googleapis.com/papyrus_images/ce0a6fb3011b3c41efccd36ab2cf47d68e22450ae2bb787c8ab28a5274d4197e.png)

https://www.connext.network/

Connext router node setup for Connext Contributor Program

Official documents:

> [Spinning Up a Router](https://docs.connext.network/routers/spinning-up)

Minimum Hardware Requirements:
------------------------------

*   8GB RAM
    
*   30GB Storage
    
*   Redis
    

Update packages
---------------

    sudo apt update && sudo apt upgrade -y
    

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
    

Install 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 
    

### Cloning 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](https://github.com/connext/nxtp/releases) 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://app.logdna.com/)
    

![https://www.logdna.com/](https://storage.googleapis.com/papyrus_images/5f3ba87a1828ada36b147dc4d1394d1363fb041c2d958c911395fbf5a2e5cf44.png)

https://www.logdna.com/

Use this commands for preparing your `.env` file

    mv .env.example .env
    
    nano .env
    

Verify your `.env` file

    ################################################################################
    
    General configuration
    
    ROUTER_VERSION=0.2.0-alpha.10
    
    ROUTER_EXTERNAL_PORT=8000
    GRAFANA_EXTERNAL_PORT=3008
    WEB3SIGNER_HTTP_LISTEN_PORT=9000
    
    ################################################################################
    
    Monitoring configuration
    
    LOGDNA_KEY=
    LOGDNA_TAG=
    
    DISCORD_WEBHOOK=
    

### 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](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 ~/nxtp-router-docker-compose/config.json
    

    {
      "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"
    }
    

### Redis Config

The router uses an internal Redis instance in Docker by default. However, if you prefer to use your external Redis instance, you can set the corresponding `host` and `port` field in `config.json`. Instructions can be found on the [Redis website](https://redis.io/).

### Web3Signer Config

Set up [Web3Signer](https://docs.web3signer.consensys.net/en/latest/) config files to set the private key securely. Fill the private key of your signer to `key.example.yaml`.

    mv key.example.yaml key.yaml
    
    nano ~/nxtp-router-docker-compose/key.yaml
    

Add your private key to to `key.yaml`.

    type: "file-raw"
    keyType: "SECP256K1"
    privateKey: "c41a12b71d297b7bea5be41f4b752"
    

### Create docker-compose service

    cd ~/nxtp-router-docker-compose
    docker-compose create
    

### Run docker-compose

    docker-compose up -d
    

### Check the logs

    docker logs --follow --tail 100 router
    

### Restart docker-compose service

    docker-compose restart
    

### Update Version

1.  Modify `.env` to change `NXTP_VERSION`
    
2.  Update stack
    

    docker-compose pull
    docker-compose up -d
    

![](https://storage.googleapis.com/papyrus_images/138e22bb500cc8d3824bb7849315f73c8e02ba0fb2542e6533f2e2ae21049561.png)

### Claim test tokens

Visit faucet and claim TEST tokens:

[https://amarok-testnet.coinhippo.io/](https://amarok-testnet.coinhippo.io/)

![](https://storage.googleapis.com/papyrus_images/c5454a3fda474ab775660579c253689d16475ba4a8267dedd8ac36b4422eab58.png)

### Add Liquidity

Paste your router address to the link

    https://testnet.amarok.connextscan.io/router/<your router address>
    

Click “Manage Router” and add your liquidity

![](https://storage.googleapis.com/papyrus_images/1726a474cdd1cb8022da10d1fe5193f64869cd0473c14dd258f0ad6347b2e594.png)

**Congratulation! You started Connext Router!**

---

*Originally published on [cyberG|DVS](https://paragraph.com/@cyberg/connext-router-setup)*
