Enter the Ravenverse
A beginners guide to RavDL v2 of Raven Protocol
4 years have passed since the AI/blockchain startup Raven Protocol started developing a decentralized and distributed network of compute nodes for Artificial Intelligence and Machine Learning. This week, they published version 2 of their library RavDL. If you’d like to give it a try and see how it works, this is your step-by-step guide to get it done.
What needs to be done (in 6 steps)
- Connect with the Ravenverse platform with Metamask
- Install prerequisites (Git, Conda, Protobuf)
- Install and configure Visual Studio Code
- Set up a Conda environment for Ravenverse
- Clone & configure the Ravenverse GitHub repository
- Do the test-run
Below, you’ll be guided through these steps in detail.
Step 1: Connect with the Ravenverse platform with Metamask
To connect with the Ravenverse platform I used the Metamask plugin in Chrome.
First, you need to set up Binance Smart Chain in Metamask. I like to expand the view for easier editing (clicking … / Expand view). There you navigate to My Accounts / Settings / Networks. If it’s not already there, add the BSC network:
Network Name: BSC
New RPC URL: https://bsc-dataseed.binance.org/
Chain ID: 56
Currency Symbol: BNB
Block Explorer URL: https://bscscan.com
It should look like this:
Then switch Metamask to the new BSC network (it’s in the top row, right next to the My Accounts button).
For the test, I would recommend to create a new account in Metamask, just navigate to My Accounts and select Create Account. Call it e.g. “Ravenverse”.
Then go to https://www.ravenverse.ai/, click Connect Metamask, and follow the prompts. After you signed, you have access to your Ravenverse test account, which should look like this:
Step 2: Install prerequisites (Git, Conda, Protobuf)
I used Brew to install the prerequisites. Just open a Terminal and execute the following commands one at a time (downloads might take a little):
/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(You will be asked for your password and prompted to confirm)
brew install git
brew install miniconda
brew install protobuf
Step 3: Install and configure Visual Studio Code
If you don’t already have Visual Studio Code installed, you can get it at https://code.visualstudio.com/. On Mac, just download, unzip and copy to Applications.
Once installed, you’ll need to extensions from its library. Select Extensions on the left side nav menu or hit Shift-Command-X and install the following:
- @id:ms-python.python
- donjayamanne.python-environment-manager
Once done, your extensions list will like like this:
Now open the newly installed Python Environment Manager (last icon on the left die nav menu in the picture above). There, click on the little icons to refresh and to download and setup Python.
Step 4: Set up a Conda environment for Ravenverse
Still in the Python Environment Manager, add an environment to Conda (click: +). You’ll be prompted for a name and Python version. Call it e.g. ravenverse and select Python version 3.8
Now click on the little run symbol next to your newly created environment to start it in the Visual Studio Code console.
There, execute the following commands one at a time (downloads might take a little):
pip install onnx
pip install onnxruntime
pip install python-dotenv
pip install scikit-learn
pip install ravop
pip install ravpy
pip install ravdl
pip install matplotlib
When done, your ravenverse environment should look like this:
Step 5: Clone & configure the Ravenverse GitHub repository
In Visual Studio Code, in the left side nav menu, go to Source control or hit Control-Shift-G. Click on Clone Repository and download the following repository:
You’ll need to choose a destination folder for it and confirm that you’ll trust the authors.
When it’s done cloning, go to the Explorer in the left side nav menu or hit Control-Shift-E. Ravenverse should show there and look like this:
You need to edit two files there:
- Provider/.env
- Requester/.env.
Both need the same content:
TOKEN=<copy your token from https://www.ravenverse.ai/>
RAVENVERSE_URL=http://server.ravenverse.ai
RAVENVERSE_FTP_HOST=server.ravenverse.ai
RAVENVERSE_FTP_URL=server.ravenverse.ai
You can find the token on the Ravenverse website from step 1.
Both .env files should look like this:
Step 6: Do the test-run
First, you’ll have to activate the environment that you created in step 4. For this, click in the Visual Studio Code command line or hit Shift-Command-P. There, enter “> Python: Select Interpreter” and select your ravenverse environment. This should look like this:
There are 3 scripts I would recommend to try out:
- Provider/run_distributed_provider.py: With this script, you turn your computer into a compute node in the Ravenverse compute network that helps train AI models.
- Requester/create_distributed_linear_regression.py: With this script, you train an exemplary AI model on the Ravenverse compute network.
- Requester/list_my_graphs.py: With this one, you can see any past and ongoing AI model traings that you ordered.
Just open the respective file and click run (top right corner).
It should look like this:
Provider/run_distributed_provider.py
Requester/create_distributed_linear_regression.py
Troubleshooting tip 1: If you get an error message that the file examples/datasets/data_linreg.txt cannot be found, switch to the Requester directory in the console (i.e. ‘cd Requester’) before starting the script.
Troubleshooting tip 2: If you get an ImportError you can try removing the “.” from line 6 in front of “.examples” where it says “from .examples import linear_regression”.
Requester/list_my_graphs.py
If you made it this far, congratulations, you just participated in next generation AI training 🚀.
Where to find more help
If you’d like to learn more, there are detailed instructions in the readme and tutorial sections of the Github repository.
For support, you can join the Raven Protocol Telegram channel; and you can meet the founders there.
There was a first Raven Protocol community call two weeks ago. To get notifications about the next one, you can also join the announcements channel.