Skip to content

Installation

Debendra Oli edited this page Aug 13, 2024 · 32 revisions

In this section, we will go through the installation process of Centralized Relay.

Prerequisites

  1. Go Language: [optional] Version 1.21.0 or higher. Make sure to have Go properly installed and configured on your system. For detailed installation instructions, please visit the Go Installation Guide.

  2. GNU Make: This is an essential build automation tool used to compile and build the project from source files.

  3. Docker: This is an essential containerization tool used to run e2e tests. To install Docker on your system, refer to the Docker Official Website. For information about the e2e tests, refer to the e2e tests section.

  4. GIT: This is an essential version control tool used to clone the project from the repository. To install GIT on your system, refer to the GIT Official Website.

  5. wget: This is an essential tool used to download the binaries from the release. To install wget on your system, refer to the wget Official Website.

  6. tar: This is an essential tool used to extract the project from the tarball. To install tar on your system, refer to the tar Official Website.

  7. aws-cli: This is an essential tool used to configure the AWS KMS with relayer. To install aws-cli on your system, refer to the aws-cli Official Website.

  8. Contracts: Relayer uses xcall and bridge connection contracts with xcall. Resources for the deploying contracts can be found Resource

Installation

  1. Prepare the environment
CPU RAM Storage
2 vCPUs 4 GB 8* GB

Note: The above configuration is recommended for the production environment.

Relay has been tested on the following operating systems:

  • Ubuntu 22.04 and later
  • MacOS 16.0 and later
  • Amazon Linux 2
  • Arch Linux
  1. For installation you can either clone the repo and install or download the binaries:
  • Build the project from source (recommended for development and testing purposes skip to step 2 below for production environment)

    Install the required packages

    ## for ubuntu and debian
    sudo apt-get update && sudo apt-get install -y wget tar make git golang-go
    ## for mac, assuming you have homebrew installed
    brew install wget tar make git
    ## for amazon linux
    sudo yum update && sudo yum install -y wget tar make git go
    ## for arch linux
    sudo pacman -Syu && sudo pacman -S wget tar make git go --noconfirm
    git clone https://github.com/icon-project/centralized-relay.git
    cd centralized-relay
    make install

    Note: The above command will build the project and install the binary in the $GOPATH/bin directory.

    Add the go binary path to the system environment variable.

    ## for bash
    echo "export GOPATH=${GOPATH-:~/go}/bin" >> ~/.bashrc
    echo "export PATH=$PATH:$GOPATH" >> ~/.bashrc
    source ~/.bashrc
    ## for zsh
    echo "export GOPATH=${GOPATH-:~/go}/bin" >> ~/.zshrc
    echo "export PATH=$PATH:$GOPATH" >> ~/.zshrc
    
    source ~/.zshrc
    ln -sf $(which centralized-relay) /usr/bin/crly

    Verify the installation and explore all the commands, sub commands and their usages.

    centralized-relay --version
  • Download binaries from releases page.

    ## for version v1.1.0
    
    wget https://github.com/icon-project/centralized-relay/releases/download/v1.1.0/centralized-relay_1.1.0_linux_amd64.tar.gz
    tar -xvf centralized-relay_1.1.0_linux_amd64.tar.gz ## for linux x86_64

    Verify the installation and explore all the commands, sub commands and their usages.

    ./centralized-relay_1.1.0_linux_amd64/centralized-relay --version
    mv /centralized-relay_1.1.0_linux_amd64/centralized-relay /usr/bin/crly ## rename centralized-relay binary to something shorter

Configuration

  1. Add chains to configuration file

    Follow through the Configuration guide to add chains to the relay.

  2. Verify the configured chains

    crly chains list
  3. Configure key store

    More information about configuring keystore is here: Keystore

  4. Configure contracts

    In this step, you can review the contract details, chain details, and keystore details. Contracts deploymnet instructions can be found here

    Add the contract details to the configuration file in the contracts section for each chain. Both xcall and connection are supported individually.

  5. Review the configuration file

    crly config show
  6. Create systemd configuration

    This step will guide you through the configurating the relay to run as a service on the system using systemd init system.

    This is only required if you want to run the relay as a service.

    sudo systemctl edit --force --full centralized-relay
    [Unit]
    Description=Centralized Relay
    After=network.target
    
    [Service]
    Type=simple
    User=ubuntu # change as required
    # Environment=AWS_REGION=us-east-1    # uncomment and change the region you want to run using if using KMS
    # Environment=AWS_PROFILE=default      # uncomment and change the profile you want to run using if using KMS
    ExecStartPre=/bin/rm -f /tmp/relayer.sock
    ExecStart=/usr/bin/crly start       # assuming the binary is moved to /usr/bin/crly
    KillSignal=SIGINT
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    Alias=crly.service
  7. Configure the relay to run as a service

    sudo systemctl daemon-reload
    sudo systemctl --now enable crly
  8. Verify the service

    sudo systemctl status crly

Helpful commands

  1. Live logs ( ctrl + c to exit )

    sudo journalctl -u crly -f
  2. Restart the service

    sudo systemctl restart crly
Clone this wiki locally