Validators
Mainnet
Setup
Getting the Validator Software

Getting the Validator Software

This guide describes how to download and run Chainflip's validator software.

Prerequisites

It's a good practice to use a fresh node and upgrade all system dependencies before installing the validator software.

sudo apt update
sudo apt upgrade -y

Adding Chainflip's apt Repo

We distribute our binaries as debian packages through our apt repository. To install the packages, you need to add our repo to your apt sources list.

Use the following commands to add Chainflip's Mainnet apt repo to your node:

  1. Download Chainflip Mainnet GPG key from the Ubuntu Key Server:
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 4E506212E4EF4E0D3E37E568596FBDCACBBCDD37
  1. Verify the key's authenticity:
gpg --export 4E506212E4EF4E0D3E37E568596FBDCACBBCDD37 | gpg --show-keys

Important: Make sure you see the following output from the terminal:

pub   rsa4096 2023-11-06 [SC]
      4E506212E4EF4E0D3E37E568596FBDCACBBCDD37
uid                      Chainflip Labs GmbH (Releaser Master Key) <security@chainflip.io>
sub   rsa4096 2023-11-06 [S] [expires: 2025-11-01]
sub   rsa4096 2023-11-06 [S] [expires: 2025-11-01]
sub   rsa4096 2023-11-06 [S] [expires: 2025-11-01]
  1. Add Chainflip's Mainnet Repo to apt sources list:

Mainnet binaries were compiled on Ubuntu 22.04 LTS (Jammy Jellyfish). Running them on other versions of Ubuntu or other Debian-like distributions may require additional dependencies and configuration.

sudo mkdir -p /etc/apt/trusted.gpg.d
gpg --export 4E506212E4EF4E0D3E37E568596FBDCACBBCDD37 | sudo tee /etc/apt/trusted.gpg.d/chainflip-mainnet.gpg
echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/chainflip-mainnet.gpg] https://pkgs.chainflip.io/ubuntu/ jammy berghain" | sudo tee /etc/apt/sources.list.d/chainflip-berghain-mainnet.list

Installing The Packages

To install, run the following commands:

sudo apt update
sudo apt install -y chainflip-cli chainflip-node chainflip-engine

Downloading Latest Chaindata Snapshot

First, download the latest chaindata snapshot and unpack it to the correct location.

mkdir -p /etc/chainflip/chaindata/chains/Chainflip-Berghain/
 
wget -O ./cf_chaindata_pruned_paritydb.tar.gz https://snapshots.chainflip.io/berghain/cf_chaindata_pruned_paritydb.tar.gz
 
tar -xzf ./cf_chaindata_pruned_paritydb.tar.gz -C /etc/chainflip/chaindata/chains/Chainflip-Berghain/
 
rm -f ./cf_chaindata_pruned_paritydb.tar.gz

After that, create a systemd override file for the chainflip-node service to use the correct parameters in order for the snapshot to be used.

sudo mkdir -p /etc/systemd/system/chainflip-node.service.d && \
sudo tee /etc/systemd/system/chainflip-node.service.d/override.conf > /dev/null <<EOF
[Service]
ExecStart=
ExecStart=/usr/bin/chainflip-node \\
  --chain /etc/chainflip/berghain.chainspec.json \\
  --base-path /etc/chainflip/chaindata \\
  --node-key-file /etc/chainflip/keys/node_key_file \\
  --validator \\
  --database=paritydb \\
  --sync=full \\
  --blocks-pruning=300 \\
  --pruning=300
EOF
 
sudo systemctl daemon-reload

Snapshots are updated every 6 hours starting at 00:00 UTC. The snapshot holds the state and blocks of the most recent 300 blocks. The size of the snapshot is approximately 50GB. You can override the snapshot to use a different number of blocks by changing the --blocks-pruning and --pruning parameters in the systemd override file.

Docker Installation

If you have done the APT Installation above, you don't need to follow the Docker Installation below.

If you are planning to run a validator using a container orchestration system like Kubernetes you can use our pre-built images on Docker Hub (opens in a new tab).

docker pull chainfliplabs/chainflip-node:berghain-1.1.1
docker pull chainfliplabs/chainflip-engine:berghain-1.1.1
docker pull chainfliplabs/chainflip-cli:berghain-1.1.1

Starting up the node in Docker

First, download the latest chaindata snapshot as explained in the Downloading Latest Chaindata Snapshot section.

To start the node, you would need the following options passed to the chainflip-node binary:

chainflip-node \
  --chain=/path/to/chainflip/dir/berghain.chainspec.json \
  --base-path=/path/to/chainflip/dir/chaindata \
  --node-key-file=/path/to/chainflip/dir/keys/node_key_file \
  --validator \
  --sync=full \
  --database=paritydb \
  --blocks-pruning=300 \
  --pruning=300

Getting the chainspec

If you have installed binaries through APT, the chainspec is already included in the chainflip-node package. However, if you need the chainspec for Kubernetes deployments or other docker orchestration systems, you can download it by running:

curl https://repo.chainflip.io/chainspecs/berghain.chainspec.json -o berghain.chainspec.json