Default - All-in-one setup

Overview

  1. You will be running a series of docker containers that collective forms the Diva service with the command: docker compose up -d

  2. The system instructions for running the above is captured in the docker-compose.yml and .envfiles of the git repository you will be downloading

  3. Open the ports used by the Diva service on your device

  4. The Diva client comes together with a Prysm validator client - indicated as "Diva client" in the diagram below.

  5. You will configure this connection via the .env file

Installing dependencies - Docker

It is recommended to run the Diva service from a Docker container. To do that, we first have to install Docker - the script below performs the following:

  1. Download and run the official Docker installation script

  2. Creates a new user group called "docker"

  3. Adds your current Linux user account to this new docker group

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

sudo groupadd docker
sudo usermod -aG docker $USER

Log out and then back in again for the new user group settings to take effect.

exit
ssh <user>@<IP_address> -p <port_no.> -i <SSH_key> -v

An automated option is provided by Diva Staking here. However, we highly recommend going through the manual process for a maximum learning outcome.

Installing the Diva client

First, make sure your OS is up to date by running general updates.

sudo apt update -y && sudo apt upgrade -y

Next, download the latest Diva Staking repository (testnet) here - https://github.com/shamirlabs/diva-alpha-net - by running:

cd
git clone https://github.com/shamirlabs/diva-alpha-net.git

An automated option is provided by Diva Staking here. However, we highly recommend going through the manual process for a maximum learning outcome.

Preparing the Docker environment (.env) file

Now, enter into the directory, rename the .env.example file to .env, and then open it up for editing.

cd diva-alpha-net
sudo mv .env.example .env
sudo nano .env

Make the following changes:

1) Amend the COMPOSE_FILE and COMPOSE_PROFILES to the following values. This will enable metrics for monitoring and telemetry for the Diva team to help you with troubleshooting.

COMPOSE_FILE=docker-compose.yml 
COMPOSE_PROFILES=clients,metrics,telemetry 

2) Connect your Diva client to your execution client via WebSocket

EXECUTION_CLIENT_URL=ws://geth:8546 

3) Connect your Diva client to your Prysm consensus client via REST API

CONSENSUS_CLIENT_URL=http://beacon:3500 
BEACON_RPC_PROVIDER=beacon:4000 

4) Choose a strong password to log into your Diva node API.

DIVA_API_KEY=changeThis  # Change this (API key for the operator UI)

5) Choose another strong password to encrypt the database of your node. This will also be useful for restoring your node in the future.

*Note: Once this parameter is set during the first start-up of the node, you won't be able to change it until such functionality is implemented. For that reason we recommend that you back it up in a safe place.

DIVA_VAULT_PASSWORD=vaultPassword # Change this (password for the encrypted vault)

6) Set a username for the logs to help developers debug issues you might find. You can choose any username you'd like, but we recommend you use the Discord username so we can reach out to you more efficiently if necessary..

Replace the value discordusername-operatoraddress of the TESTNET_USERNAME with the discord username that you want to use in the testnet and your operator address (for instance, prada-0x0000000000000000000000000000000000000000). This information is only available to the Shamir Labs development team and is not publicly available. It could be used to contact testnet participants if the team needs debugging information (such as logs), a database file, or to communicate an important patch/update.

Your username has no functional importance and is purely to label your node with a human-readable name.

TESTNET_USERNAME=discordusername-operatoraddress  # Change this (recommended to discord username and ethereum address of the operator)

Save your changes and exit by pressing CTRL+O, ENTER, & CTRL+X

Open required ports

Your Diva client needs to talk to other nodes in order to perform signatures, receive duties, and find peers.

As such, the following port configurations are needed.

  1. Port 5050 used for P2P communication MUST be open on your machine and exposed to the public internet

  2. Port 80 is used by the Operator UI and you SHOULD open it if you want to serve the Operator UI

  3. Port 30000 is used to access the swagger API of your node and you SHOULD keep it open if you want to use the Operator UI

Open ports on your firewall rules

sudo ufw allow 5050
sudo ufw allow 80
sudo ufw allow 30000

If you are running a machine on a local network, remember to also configure port forwarding on your router to port 5050 on your node. Refer to the port forwarding section on how to do this.

pageAdvanced networking

Preparing the docker compose file

Open up the docker-compose.yml file.

cd diva-alpha-net
sudo nano docker-compose.yml

Amend the ports: section of the grafana service to "3001:3000". This is so that the Grafana service running on docker does not clash with your native Grafana service.

# Metrics
  grafana:
    image: grafana/grafana:10.2.5
    user: root
    container_name: grafana
    profiles:
      - metrics
    hostname: grafana
    restart: unless-stopped
    ports:
      - "3001:3000"
    volumes:
      - ${DIVA_DATA_FOLDER:-.}/grafana/config:/etc/grafana/provisioning
      - ${DIVA_DATA_FOLDER:-.}/grafana/data:/var/lib/grafana
      - ${DIVA_DATA_FOLDER:-.}/grafana/config/grafana.ini:/etc/grafana/grafana.ini

You will then be able to run both Grafana services without conflicts. Access each of the dashboards via:

  1. Native Grafana: <IP_address:3000>

  2. Docker Grafana: <IP_address:3001>

Run the Diva client

After editing the .env file, you can now fire up the Diva Staking service using docker.

cd ~/diva-alpha-net
docker compose up -d

*Note: Make sure you are in the same directory as where the docker-compose.yml file is. By default, this is in the diva-alpha-net directory.

Monitor the logs of the Diva service container:

docker logs -f diva

Expected output: There are 3 things to look out for - "connected to execution client", "consensus client available", and "running diva client".

Note: There will be a warning that says "cannot start p2p network without identity". This is expected as your Diva node is yet to be registered at this point.

Troubleshooting

If you encounter any errors, perform the following steps sorted by priority to troubleshoot:

1) Check your .env files to make sure that all of your input details are correct. Check against the configuration files of your execution and consensus clients.

Then, restart the docker containers.

docker restart $(docker ps -a -q)

2) Stop and remove the docker containers. Then repeat the steps on this page.

docker rm -f $(docker ps -a -q)

3) Perform (2) + delete the Diva git repository. Then repeat the steps on this page.

cd
sudo rm -r diva-alpha-net

Last updated