# RavSock

RavSock is the second most crucial building block of the framework. It sits between the developer(who create ops and write algorithms) and the contributor who contribute the idle computing power. It facilitates the efficient distribution of ops and the efficient merging of results.

[Github](https://github.com/ravenprotocol/ravsock.git)

## Setup

### Installation

#### Create a virtual environment with Python 3.8 before you install RDF libraries

```
conda create -n <env_name> python=3.8
```

#### Clone repository

```
git clone https://github.com/ravenprotocol/ravsock.git
```

#### Set up everything and install dependencies

```
sh setup.sh
```

### Configure Paths

Navigate to `ravsock/config.py` and set the `FTP_ENVIRON_DIR` variable to the `bin` folder of your python virtual environment. For instance:

```
FTP_ENVIRON_DIR = "~/miniconda/envs/<env_name>/bin"
```

Note: Set `ENCRYPTION = True` in the same file if a layer of homomorphic encryption needs to be added for Federated Analytics.

Set `RDF_DATABASE_URI` in the same file.

```
RDF_DATABASE_URI = "sqlite:///rdf.db?check_same_thread=False"
```

Create database with tables required for the project.

```
python reset.py  
```

The server is now configured correctly and ready to be fired up.

### Start Ravsock Server

Ravsock is a crucial component of RDF that facilitates both federated and distributed functionalities of the framework.

It sits between the developer(who creates ops and writes algorithms) and the contributor who contributes the idle computing power. Its scheduling algorithm oversees the distribution and statuses of different Ops, Graphs and Subgraphs across multiple Clients.

```
python3 run.py
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ravenprotocol.gitbook.io/ravenverse/ravsock.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
