By the end of this guide, you should know how to run a Watcher on your local machine, on VPS, or a bare-metal server. The guide is useful for enterprise clients who want to integrate with the OMG Network.
Goals
You should use this guide if you need to accomplish one of the following goals:
Rely on a personal Watcher to verify transactions and receive network's events
Host a redundant Watcher node to secure the network
Be an active participant of the network
Prerequisites
Basic knowledge of Linux and blockchain technology
A laptop/PC, a Linux-based VPS, or a bare-metal server
A fully synced Ethereum client
Ethereum client is required to synchronize transactions on the OMG Network with the Ethereum Network. The easiest way to have a full ETH client is to use one of the Ethereum infrastructure providers. Our team has tried and but other providers may work too.
Supported Platforms
The Watcher has been tested on the following environments:
Ubuntu 16.04
Ubuntu 18.04
Alpine 3.11
macOS 11.0.0 (local usage only)
Note, it might be possible to run a Watcher on other environments. Above are provided the systems that have been tested.
Minimum Hardware Requirements
The following hardware is required to run a Watcher:
Storage: 8GB SSD
CPU: 1 CPU Core with at least 2.2 GHz
RAM: 4GB
Bandwidth: 20 Mbps
The requirements are based on the network's load in Q3 2020. It is recommended to use hardware with higher performance to avoid a potential increase in transaction volume.
Costs
The costs of running a Watcher include the following components:
A full Ethereum node (local or ETH provider)
DevOps setup and maintenance fee
Setup
Before installing Watcher service on a server or your local machine, you should have a few things setup:
1. Log in to Your Server
If you're planning to install a Watcher on a remote server (VPS or bare-metal), make sure to have an active session open before proceeding with the guide.
You can log in using the following command from your terminal or command prompt:
ssh $USER@$REMOTE_SERVER -p $PORT
$USER - the name of the user with root privileges used to log into the remote server. Default: root.
$REMOTE_SERVER - an IP address of your remote server.
$PORT - a port used to connect to the server. Default: 22.
2. Check TCP ports
Make sure you have don't have any of the services running on one of the following ports: 7434, 7534, 5432. The ports are used as follows:
7434: watcher, a light-weight Watcher to ensure the security of funds deposited into the childchain
7534: watcher_info, a convenient and performant API to the child chain data
5432: postgres, a PostgreSQL database that stores transactions and contains data needed for challenges and exits
You can use lsof, netstat or other alternatives to check occupied ports:
sudo lsof -i -n -P | grep LISTEN
If you found one of the ports is already in use, kill the process the port is occupied with as follows:
sudo lsof -t -i:$PORT
sudo kill -9 $PID
$PORT - a port to clear from other processes
$PID - process ID listening on a defined port
If you're already using Docker, verify these ports are free too:
docker ps
3. Update Packages
If you're using a Linux-based system, make sure to update your packages:
sudo apt-get update
Install
Running a Watcher locally is recommended for testing purposes only. For production, you should use VPS or a bare-metal server. This allows increasing uptime, reducing latency, and configuring advanced security measures for your instance.
Bare-metal (Ubuntu)
Docker Compose (Ubuntu)
Docker Compose (macOS)
1. Install Dependencies
1.1 Install Erlang and Elixir
sudo apt-get install libssl-dev make automake autoconf libncurses5-dev gcc unzip
If you've used these libraries before, you may proceed to asdf installation as follows:
You will have to log out from a server for installed dependencies to take affect.
1.3 Verify
To verify the installed dependencies, use the following commands:
docker -v && docker-compose -v
Example output:
Docker version 19.03.9, build 9d988398e7
docker-compose version 1.25.5, build 8a1c60f6
2. Set Up Configuration Files
2.1 Configure docker-compose-watcher.yml File
Docker Compose allows defining and running multi-container Docker applications. To launch a Watcher with Compose, first, create a YAML file that will contain configurations for our services with nano or vim text editor:
mkdir watcher && cd watcher && nano docker-compose-watcher.yml
2.2 Configure an Environment File
The YAML file has several values that have to be configured in .env file as follows::
Docker daemon uses Linux-specific kernel features, therefore you can’t run Docker natively on macOS. You'll have to install docker-machine in order to create VM and attach it to.
brew update && brew install docker docker-machine
1.3 Install Docker-Machine Dependencies
Docker-machine relies on VirtualBox, so you have to install it as well:
brew cask install virtualbox
If the installation fails, you'll see the Security & Privacy window opened. Unlock the settings and enable an extension by Oracle as follows:
1.4 Create a Default Docker-Machine
Next, you'll have to create a default machine, specify the name of the machine that Docker will use to execute commands, and connect your shell to the new machine.
You can verify that your machine was created as follows:
docker-machine ls
Example output:
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp:
1.5 Install Docker Compose
The current guide will demonstrate how to set up and manage a Watcher via Docker Compose tooling due to the simplicity of running this on your laptop/PC.
To verify the installed Docker and Compose, use the following commands:
docker -v && docker-compose -v
Example output:
Docker version 19.03.12, build 48a6621
docker-compose version 1.26.0, build d4451659
2. Configure and Run the Watcher Instance
The rest of the steps are the same as described in the Docker Compose guide for Linux-based systems. Proceed to 2. Set Up Configuration Files of the Docker Compose tab to finish the installation.
Verify
To verify that you're fully synced, check the status of Watcher and Watcher Info:
Watcher Info
curl -X POST "http://$REMOTE_SERVER:7534/status.get"
$REMOTE_SERVER - an IP address of your remote server. If you run the Watcher on your local machine, replace the value with the localhost.
There are two ways to test that your Watcher is working properly:
$REMOTE_SERVER - an IP address of your remote server. If you run the Watcher on your local machine, replace the value with the localhost.
VPS, bare-metal server, or local machine that matches
The configuration process takes a significant amount of time and may require help from your DevOps team. This step is fully covered in the guide.
This method shows how to install and run a Watcher from a bare-metal release of the repository. It is a recommended approach for production use. You can run it on VPS, dedicated, or bare-metal server on one of the .
The current implementation is built with Erlang and Elixir and uses to manage multiple runtime versions. Asdf relies on several libraries that you may need to install first:
2.1 Clone Repository
Note, these values live within your current shell's context. So you need to run this command again on system restart, exiting the shell, etc. To permanently set these values, check .
If you want to set up additional configurations, refer to .
Then, repeat the steps starting from .
This method shows how to set up and run a Watcher via Docker Compose tooling. You can run it on your local machine, VPS, dedicated, or bare-metal server on one of the .
Make sure to install the latest version of Docker Compose from the .
The Watcher consists of watcher and watcher_info services. You can run watcher separately, however, watcher_info relies on the PostgreSQL database where it stores the network's data. All releases and corresponding Docker images (starting from 1.0.1) can be found in our .
Then, copy and paste the , save the changes with ctrl+o (Linux/Windows) or control+o (macOS) and Enter to confirm the changes respectively. Then exit the file with ctrl+x or control+x.
$WATCHER_IMAGE - the latest stable image (e.g. omisego/watcher:1.0.3)
$WATCHER_INFO_IMAGE - the latest stable image (e.g. omisego/watcher_info:1.0.3)
Use http://$REMOTE_SERVER:7534 as a WATCHER_URL value in your configs to make a transfer in your own or one of the OMG Network projects, such as .