Setting up the BRP


Prerequisites for Validator & Operator nodes

1

Provide Covalent with two public addresses

  1. Staking Address: This is the address of the wallet holding your CQT on Ethereum mainnet.

  2. Operator Address: This is a public address tied to the private-public key pair an operator will use to sign proof transactions to the proof-chain contract on moonbeam.

  • Please provide the public address to this pair to Covalent. Keep the private key secret and safe. Please make sure that the Staking address and Operator Address are separate.

It can be generated using the BIP-44 mnemonic multi-account deterministic algorithm. It can be generated using https://iancoleman.io/bip39/ (select 24 words, Coin: ETH).  
2

CQT

Min 35,000 CQT & Max 70,000 CQT on Ethereum mainnet.

3

GLMR is needed to pay for gas on Moonbeam

  • In order to send proofs of block specimens. This costs approximately 5 GLMR per day. This should be held at the same address as the Operator Address.

4

Access the Covalent Network Operator Dashboard.

Import your Validator private key into Metamask, select the Ethereum mainnet network and connect your Staking wallet to the operator dashboard. Your operator should be currently disabled

5

Self-Stake the Minimum CQT Staking requirement on Ethereum (35,000 CQT) for BRP. This is done using the Change Stake button in your operator dashboard. Proceed to first set Stake Amount to 35000 and click Approve.

6

After the on chain approval transaction completes, click on Stake. Once the staking transaction completes, your Staking Status should display Sufficiently Staked and Enabled

7

Get access to a reliable Moonbeam https RPC. Providers and RPC URLs can be found here. Ping the Covalent team on discord for recommendations.

9

Validators can create a web3.storage account and have did key, W3-agent-key and proof.out for ipfs-pinner file or can reach out to covalent team on discord for these details.

Install Dependencies:


As we discussed in previous section, We can setup the nodes two ways so here in this section, you can follow dependencies accordingly:

Dependencies to Run with Docker Compose:

1.Install Docker

Follow the docker install instructions for your platform/architecture.

Onboarding instructions will be based on Ubuntu 22.04 LTS x86_64 / amd64.

2. Install direnv

Debian/Ubuntu

Bash
sudo apt update
sudo apt get direnv

# bash users - add the following line to your ~/.bashrc
eval "$(direnv hook bash)"
source ~/.bashrc

# zsh users - add the following line to your ~/.zshrc
eval "$(direnv hook zsh)"
source ~/.zshrc

MacOS 12.x (M1/Intel)

Bash
brew install direnv

Dependencies to Run with Source:

Prerequisites

MacOS 12.x (M1/Intel) Installation requirements

Install XCode (skip if you already have xcode and have been developing on your mac)

Bash
xcode-select --install
sudo xcodebuild -license
agree

You must also Install brew (for mac m1/intel) with this script. This installs all the minimum necessary terminal/command-line tools to get started with easy software development on a mac.

Installation Time: 35-40 mins depending on your machine and network.

Install git, go, asdf, erlang, elixir, direnv, go-ipfs

  • Git is used as the source code version control manager across all our repositories.

  • Go is the programming language that is used to develop on go-ethereum, bsp-agent, erigon (EVM plugin) all which are entirely written in go.

  • Asdf is a CLI tool that can manage multiple language runtime versions on a per-project basis.

  • Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability.

  • Elixir is a programming language that runs on the Erlang VM, known for creating low-latency, distributed, high concurrency fault-tolerant systems.

  • IPFS as the InterPlanetary File System (IPFS) is a protocol, hypermedia and file sharing peer-to-peer network for storing and sharing data in a distributed file system.

  • Direnv is used for secret management and control. Since all the necessary parameters to the agent that are sensitive cannot be passed into a command line flag. Direnv allows for safe and easy management of secrets like ethereum private keys for the operator accounts on the Covalent Network and redis instance access passwords etc. As these applications are exposed to the internet on http ports it’s essential to not have the information be logged anywhere. To enable “direnv” on your machine add these to your ~./bash_profile or ~./zshrc depending on which you use as your default shell after installing it using brew.

Here, are the commands that can be used to install the dependencies select based on your OS accordingly

MacOS 12.x (M1/Intel) Install dependencies

Bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

brew install coreutils curl git wget direnv asdf

For setting up asdf on other shells please refer to this guide.

Linux x86_64 (Ubuntu 22.04 LTS) Install dependencies

Bash
sudo apt update
sudo apt install build-essential coreutils libssl-dev automake autoconf libncurses5-dev curl git wget direnv unzip

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.2
echo ". $HOME/.asdf/asdf.sh" >> ~/.bashrc
echo ". $HOME/.asdf/completions/asdf.bash" >> ~/.bashrc
source ~/.bashrc
1

Install required asdf version manager plugins for erlang and elixir

asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf plugin add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf plugin add golang https://github.com/kennyp/asdf-golang.git
2

Add to your bash shell for asdf (for any other shell, check the asdf guide.)

echo -e "\n. \"$(brew --prefix asdf)/etc/bash_completion.d/asdf.bash\"" >> ~/.bash_profile
3

Install Erlang and Elixir using the plugins

asdf install erlang 25.3
asdf install elixir 1.14.3-otp-24
asdf install golang 1.18.1
4

Set the versions

This will create a 

.tool-versions

 file in your home directory. ASDF will use these versions whenever a project doesn't specify versions of its own.

asdf global erlang 25.3
asdf global elixir 1.14.3-otp-24
asdf global golang 1.18.1
5

Enable direnv for shell/zsh

#bash users - add the following line to your ~/.bashrc
eval "$(direnv hook bash)"

#zsh users - add the following line to your ~/.zshrc
eval "$(direnv hook zsh)"
6

After adding this line do not forget to source your bash / powershell config with the following, by running it in your terminal

source ~/.zshrc
source ~/.bashrc
7

Install latest go-ipfs (kubo) and initialize go-ipfs

MacOS 12.x (M1/Intel)

wget https://dist.ipfs.tech/go-ipfs/v0.18.0/go-ipfs_v0.18.0_darwin-arm64.tar.gz
tar -xzvf go-ipfs_v0.18.0_darwin-arm64.tar.gz
cd go-ipfs
bash install.sh
ipfs init

Linux x86_64 (Ubuntu 22.04 LTS)

wget https://dist.ipfs.tech/go-ipfs/v0.18.0/go-ipfs_v0.18.0_linux-amd64.tar.gz
tar -xzvf go-ipfs_v0.18.0_darwin-arm64.tar.gz
cd go-ipfs
bash install.sh
ipfs init
8

Note: To avoid permissions and netscan issues execute the following against ipfs binary home directory application

sudo chmod -R 700 ~/.ipfs
ipfs config profile apply server