<div align="center">
<img src="https://user-images.githubusercontent.com/36446402/217179360-b39cf6b8-456c-4d40-bedc-afe8eee62611.svg" width="200" height="100">
<h1> Ravpy - The Provider's Library </h1>
</div>
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](https://www.ravenverse.ai/).
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
```bash
pip install ravpy
```

## Usage
This section details how to join Ravenverse as a Provider. The relevant scripts are available in the [Ravenverse Repository](https://github.com/ravenprotocol/ravenverse). 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:
```bash
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:
```python
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:
```python
from ravpy.utils import list_graphs
list_graphs(approach="distributed")
```
<img width="1423" alt="Screenshot 2023-03-22 at 11 22 44 AM" src="https://user-images.githubusercontent.com/36446402/226816986-d28fbacb-aed6-4113-b808-43d0153f9521.png">
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.<br><br>
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):
```python
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. <br>However if the provider disconnects before the computation of their share of subgraphs, a portion of the staked amount will be deducted.

### Participate in Federated Analytics
```python
from ravpy.federated.participate import participate
participate(graph_id=3, file_path="<file_path>")
```

<!-- ## How to Contribute -->
## License
<a href="https://github.com/ravenprotocol/ravpy/blob/master/LICENSE"><img src="https://img.shields.io/github/license/ravenprotocol/ravpy"></a>
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
Raw data
{
"_id": null,
"home_page": "https://github.com/ravenprotocol/ravpy",
"name": "ravpy",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "Ravpy,python client library for providers",
"author": "Raven Protocol",
"author_email": "kailash@ravenprotocol.com",
"download_url": "https://files.pythonhosted.org/packages/f3/5d/a77c0fbb791455f2d82c388996eadd12df30fa9ff8a2291f270edbcca5bf/ravpy-0.20.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n <img src=\"https://user-images.githubusercontent.com/36446402/217179360-b39cf6b8-456c-4d40-bedc-afe8eee62611.svg\" width=\"200\" height=\"100\">\n<h1> Ravpy - The Provider's Library </h1>\n</div>\n\nIntroducing Raven Protocol's Python SDK for Providers that allows compute nodes across the world to participate in the Ravenverse. \n\nProviders 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).\n\nRavpy 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](https://www.ravenverse.ai/).\n\nRavpy 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. \n\n\n\n## Installation\n\n### With Pip\n\n```bash\npip install ravpy\n```\n\n\n## Usage\n\nThis section details how to join Ravenverse as a Provider. The relevant scripts are available in the [Ravenverse Repository](https://github.com/ravenprotocol/ravenverse). It is recommended to clone the Ravenverse repo and navigate to the ```Provider``` folder, where scripts for following steps are available.\n\n### Setting Environment Variables\nCreate a .env file and add the following environment variables:\n\n```bash\nRAVENVERSE_URL=http://server.ravenverse.ai\nRAVENVERSE_FTP_HOST=server.ravenverse.ai\nRAVENVERSE_FTP_URL=server.ravenverse.ai\n```\n\nLoad environment variables at the beginning of your code using:\n\n```python\nfrom dotenv import load_dotenv\nload_dotenv()\n```\n\n### Participate in Distributed Computing\nA Provider can choose which graph to participate in. In order to list which graphs are available, the following command can be used:\n\n```python\nfrom ravpy.utils import list_graphs\n\nlist_graphs(approach=\"distributed\")\n```\n\n<img width=\"1423\" alt=\"Screenshot 2023-03-22 at 11 22 44 AM\" src=\"https://user-images.githubusercontent.com/36446402/226816986-d28fbacb-aed6-4113-b808-43d0153f9521.png\">\n\n\nThis 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.<br><br>\nThe following command can be run to participate in a graph (the Provider must note the id of the graph they wish to participate in):\n\n```python\nfrom ravpy.distributed.participate import participate\n\nparticipate(token='<token>',graph_id=4)\n```\n\nUpon 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. <br>However if the provider disconnects before the computation of their share of subgraphs, a portion of the staked amount will be deducted.\n\n\n\n\n### Participate in Federated Analytics\n\n```python\nfrom ravpy.federated.participate import participate\n\nparticipate(graph_id=3, file_path=\"<file_path>\")\n```\n\n\n\n<!-- ## How to Contribute -->\n\n## License\n\n<a href=\"https://github.com/ravenprotocol/ravpy/blob/master/LICENSE\"><img src=\"https://img.shields.io/github/license/ravenprotocol/ravpy\"></a>\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "",
"version": "0.20",
"project_urls": {
"Homepage": "https://github.com/ravenprotocol/ravpy"
},
"split_keywords": [
"ravpy",
"python client library for providers"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f35da77c0fbb791455f2d82c388996eadd12df30fa9ff8a2291f270edbcca5bf",
"md5": "46c9aeddff6896439a8bb03b0e8a4edd",
"sha256": "5d023342cb68bad89afbbef58c768cd49fa4a1a3c03dfa86f7662f77f038d0c9"
},
"downloads": -1,
"filename": "ravpy-0.20.tar.gz",
"has_sig": false,
"md5_digest": "46c9aeddff6896439a8bb03b0e8a4edd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 33121,
"upload_time": "2023-06-12T09:23:08",
"upload_time_iso_8601": "2023-06-12T09:23:08.223091Z",
"url": "https://files.pythonhosted.org/packages/f3/5d/a77c0fbb791455f2d82c388996eadd12df30fa9ff8a2291f270edbcca5bf/ravpy-0.20.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-12 09:23:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ravenprotocol",
"github_project": "ravpy",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "ravpy"
}