Enter the Dōjō: Building Celo Validator Infrastructure

Keyko’s how-to guide for setting up and deploying the infrastructure needed to run a Celo validator.

Javier Cortejoso de Andrés
Keyko
7 min readJun 4, 2020

--

At Keyko, we’re attracted to projects that make a difference, and Celo is the perfect example of a project we love. Celo is a proof-of-stake (PoS) blockchain network with smart contracts aimed at providing an open financial platform for all. It’s inclusive and aimed at tackling some the world’s most pernicious issues. Celo also offers the added benefit of potential return on investment for anyone who joins as either as as a validator or in support of another validator.

Keyko joined the journey to the Celo project by actively contributing tools (explorer, celostats, validator-explorer), and also running our own validator. In this post, we will explore how you can set up your own validator.

Source: Wikimedia Commons

Choosing the environment

Choosing the right environment for your validator is handy. You can choose to use your own infrastructure, or you can think about running in some Cloud environment. The availability, stability, and connectivity are key aspects that will impact the quality of your validator, as well as security.

At Keyko, we are convinced about using approaches that improve the availability and agility without compromising in any sense the security of the setup. For our first validator, we chose to use Google Cloud, as we had extensive experience in this cloud and also could also gain experience contributing to the Celo Network in tandem.

The setup

We use the recommended proxy-validator setup, limiting access to the validator via port 30503 by the Proxy Node. For deployment tool we use Terraform and Vault for secret backing. For simplicity purposes, we will omit this part on this example and will explain how to set up both nodes. Additionally, we will show you how to set up basic monitoring, though a more convenient pipeline is also suggested. Most of the steps are based on the official documentation page.

Accounts

We need to generate two Ethereum key pairs, one used for the validator node etherbase account (and must be authorized as validator signer), and another used for the proxy nodekey. If you do not have these accounts previously, you can generate using `celocli` in your workstation:

These values must be stored securely.

Base system and dependencies

Celo artifacts are distributed as Docker containers, so the portability and compatibility among most any modern Linux distribution is assured. In this example, we are using Debian 10 Buster, but you can easily adapt them to your favorite distribution.

The first step would be installing Docker:

We will configure the Docker log options to keep the local storage consumption low (for the Keyko validator, the logs are forwarded to Stackdriver for better monitoring):

Proxy

Proxy should allow connections to ports 30303/tcp and 30303/udp, so it must be publicly exposed to improve the connectivity and be able to establish connections to other peers and validators. You can configure a more advanced network setup, but the simplest solution is assigning a public IP to this instance and configure the firewall rules or security groups accordingly.

Validator

Validator setup follows the same pattern. However, as said before, it should not be exposed directly to the Internet. Notice that for the `PROXY_PUBLIC_KEY` we trim the first `04` bytes from the output returned with `celocli`:

Source: “Subway Tunnel” by Nappa

Basic Monitoring

In the last step, we will set up a basic monitoring scheme based on https://github.com/gruntwork-io/health-checker to check that the node is syncing the latest blocks. These steps can be reproduced on both nodes.

Firstly we will install `health-checker` and `jq` as a dependency:

Now we will set up one script that will check that our node is syncing blocks. This script can be adapted to check additional things:

Finally, we setup the systemd unit for the health-checker and verify it works:

Now you can configure your favorite alerting tool to check `/` on port 6000.

Source: Wikipedia

I would like to thank all of the Keyko team for helping and supporting this process. Also from Keyko, we would like to thank Celo.org for allowing us to take part in their Journey to make financial tools accessible to all.

Here are some links with tools we help contributing to Celo Platform:

Vote for Us!

Keyko is looking for more votes on our Validator Group to run another Validator and stay elected, and we’d love to welcome you into our dōjō! Here’s a little bit of background to entice you through our doors:

  • We assisted in implementing the Celo Blockchain as a launch partner https://keyko.io/#projects-top.
  • We are looking for at least 1 million more votes to run another validator.
  • We have one validator that’s already has accumulated uptime, so voters can start earning right now. Currently it has a score of: 90+%!
  • The Keyko validator has 100% uptime in every epoch that it was elected in.
  • Details about the Validator Group can be found here: https://celo.keyko.io.
www.keyko.io

--

--