Running the BVS

This guide will walk you through running your own BVS by utilizing our Hello World BVS example.

Prerequisites and dependencies

The Hello World BVS requires a few components from your system. This guide assumes you are using a common Linux distribution with systemd as the init system. If you're using a different setup, we assume you already possess the necessary knowledge to configure your environment appropriately.

  • Golang compiler

  • Working Redis server (By default, the BVS expects it on localhost:6379. However, please feel free to use other addresses and change the configuration accordingly).

  • git

Installing dependencies on Linux

For Ubuntu and other Debian-based system run:

sudo apt-get install redis golang-go

For Arch based systems, run:

sudo pacman -S redis go

For Fedora and other RHEL based systems:

sudo dnf install golang redis

After installing Redis, you can start the service using the following command:

sudo systemctl start redis.service

It's advisable to check if Redis has started correctly. You can do this by running the following command:

sudo systemctl status redis

You should see the status as active (running), and it should indicate that it is listening on port 6379.

Installing dependencies on MacOS

We recommend using Homebrew to install dependencies. Please follow Homebrew's installation instructions before proceeding. Afterwards, install redis.

After installing Redis, you can start the service using the following command:

It's advisable to check if Redis has started correctly. You can do this by running the following command:

You should see the status as both loaded and running

Afterwards, please follow the instructions on the Golang install page to install the Go compiler.

Running the Hello World BVS

Without deploying your own contract, you will only be able to run the monitor, caller, and the off-chain compute (assuming you have registered as an operator).

For instructions on configuring the BVS to use alternative accounts, please refer to the deploying a BVS section.

Step 1: Clone repository

Clone the repository and cd into it.

Step 2: Prepare your environment

You should firstly edit go.mod in devnet-hello-world-bvs to your cloned satlayer-api lib path:

Now, start each component in the following sequence.

Each pre-formatted text block should be interpreted as a new terminal session, starting from the root of the Hello World BVS project.

Each program folder contains a env.toml file, which stores configuration for the off-chain programs. To make the Hello World program run successfully, modify your env.toml to point towards your account and use the os keyring backend.

Step 3: Run or Start the Task Monitor

First, run the task monitor. In this example BVS, the monitor continuously tracks and updates the status for display. While this service is not technically required for a BVS, it is useful during development.

This will initiate the monitor, allowing you to see real-time updates and statuses as tasks are processed in your Hello World BVS.

Step 4: Run off-chain process

Next, run the off-chain process. This program listens for tasks to perform the desired computation.

Step 5: Run Aggregator

Afterwards, you can run the Aggregator, which collects results from the above off-chain process and submits to the blockchain.

This Hello World BVS example does not need aggregation due to it's simplicity. We implemented it as a demonstration of what can be done. In a more advanced BVS, you can implement your own quorum or other availability schemes, along with additional on-chain capabilities. This approach enhances the reliability and robustness of task processing within the BVS framework.

Step 6: Run RewardUploader

Once you have ran the previous sequence, you can run RewardUploader which listens for finished results, calculates how future rewards should be spread and uploads it to the blockchain.

Step 7: Run TaskCaller

At the last sequence, run TaskCaller. In the real world, this would be a BVS client.

In this Hello World BVS example, it loops and tries to make BVS invocations every few seconds.

Last updated