Skip to content

Latest commit

 

History

History
87 lines (54 loc) · 4.23 KB

README.md

File metadata and controls

87 lines (54 loc) · 4.23 KB

Ravpy - The Provider's Library

Introducing Raven Protocol's Python SDK for Providers that allows compute nodes across the world to participate in the Ravenverse.

Providers are those who are willing to contribute their local system's idle compute power to execute the requester's computational requirements in return for rewards (Raven Tokens).

Ravpy is a python SDK that allows providers to intuitively participate in any ongoing graph computations in the Ravenverse. Ravpy nodes are authenticated based on their Ravenverse tokens which must be first generated by visiting the Ravenverse website.

Ravpy connects to Ravsock (backbone server) from which it receives subgraphs (small groupings of Ravop operations) based on a benchmarking procedure. During this procedure, Ravpy client systems are rigorously tested on a variety of operations and the results are utilized by Ravsock for efficiently assigning complex subgraphs to the provider.

-----------------------------------------------------

Installation

With Pip

pip install ravpy

-----------------------------------------------------

Usage

This section details how to join Ravenverse as a Provider. The relevant scripts are available in the Ravenverse Repository. It is recommended to clone the Ravenverse repo and navigate to the Provider folder, where scripts for following steps are available.

Setting Environment Variables

Create a .env file and add the following environment variables:

RAVENVERSE_URL=http://server.ravenverse.ai
RAVENVERSE_FTP_HOST=server.ravenverse.ai
RAVENVERSE_FTP_URL=server.ravenverse.ai

Load environment variables at the beginning of your code using:

from dotenv import load_dotenv
load_dotenv()

Participate in Distributed Computing

A Provider can choose which graph to participate in. In order to list which graphs are available, the following command can be used:

from ravpy.utils import list_graphs

list_graphs(approach="distributed")

Screenshot 2023-03-22 at 11 22 44 AM

This command displays a list of executed graphs along with the minimum requirements to participate in their computation, including system requirements and minimum stake required. A provider can participate in a graph only if their system meets these requirements and they have sufficient tokens in their account to meet the minimum stake amount.

The following command can be run to participate in a graph (the Provider must note the id of the graph they wish to participate in):

from ravpy.distributed.participate import participate

participate(token='<token>',graph_id=4)

Upon participation, the Provider will be assigned a number of subgraphs to execute. Once they have been executed, the results will be sent to the Ravsock server. The full staked amount will be returned along with their earnings on successful computation of all assigned graphs.
However if the provider disconnects before the computation of their share of subgraphs, a portion of the staked amount will be deducted.

ezgif com-optimize

Participate in Federated Analytics

from ravpy.federated.participate import participate

participate(graph_id=3, file_path="<file_path>")

-----------------------------------------------------

License

This project is licensed under the MIT License - see the LICENSE file for details