Strategies with Validator Nodes - Ritual Network

In early 2023, ChatGPT reached 100M active users, drawing public attention to the field of artificial intelligence. In the crypto sector we have seen many cryptos benefit from this AI narrative, among the many tokens $TAO comes to mind.

Today, however, I am not going to talk about AI token speculation, but about an extremely interesting project that managed to win in a $25M funding round from Archetype Fund, Robot Ventures, Accomplice and other VCs.

I'm talking about Ritual Network.

What’s Ritual Network?

According to Archetype Fund, Ritual Network is building the foundation of an open-source AI infrastructure in the form of an incentive network, connecting computing devices to each other.

The founders, Niraj Pant (who worked at Polychain) and Akilesh Potti (who worked at Polychain and Palantir), lead a team with experience in both AI and crypto, trying to find the right synergy between the two worlds.

Ritual identifies some structural problems in the current AI stack:

  • no guarantees regarding computational integrity (is the model running correctly?);

  • no guarantees regarding respect for privacy;

  • absence of resistance to censorship;

  • permissioned & centralized APIs, hosted by a few highly centralized corporations, leading to liveness problems;

  • high computational costs & limited access to proper hardware;

  • oligopolistic control over AI models, often kept closed-source because there is no economic incentive to make them open.

Ritual is an open, modular infrastructure and lends itself to becoming an execution layer for AI. It allows creators to host their models on nodes, whether they are LLMs (Large Language Models) or classic ML models; each model is accessible with a single, common API.

Ritual's architecture
Ritual's architecture

Infernet is the product that intends to bring AI on-chain, allowing it to be directly exposed to smart contracts and enabling anyone to build permissionless on top of Ritual by accessing the network of models and compute providers.

The modular nature of Ritual Network allows it to then interface natively with any protocol and application on any chain, using Ritual specifically as an AI coprocessor

Modular architecture of Ritual Network
Modular architecture of Ritual Network

To learn more about the architecture of Ritual Network, visit here.

Infernet Node - Step-by-Step Guide

To begin the procedure, you need a computer with any Linux distro installed, Ubuntu 20.04 or later will do, an SSD with +200 GB and a fast Internet connection.

For those without resources capable of supporting a validator node at home, you can fall back on VPS (Virtual Private Server) solutions, that is, you can rent a virtual server.

There are several solutions, which I recommend below:

  • Contabo, I recommend the Cloud VPS M model, with 6 vCPU Cores, 16 GB RAM, 400 GB SSD SATA3;

  • Aeza, I recommend at least the VIEs-3 or PARs-3 model, with 4 vCPU Cores, 8 GB RAM, 120 GB NVMe. This is a Russian VPS service and payment by credit/debit card is not possible from many Western countries, but payments in crypto (BTC, BEP20, ERC20, TRC20, DASH, LTC, XMR...) are possible.

After payment is made, you will receive the IP address to access.

If operating from Windows, open Windows Powershell and launch the following command, entering your IP address instead of IP_ADDRESS:

ssh root@IP_ADDRESS

Give confirmation to save ED25519 key fingerprint to the list of known hosts, available at C:\Users\WINDOWS_USER\.ssh and enter the password of your VPS.

If you have done everything correctly, the following screen will appear:

After login on Powershell on VPS provided by Contabo 
After login on Powershell on VPS provided by Contabo 

Now let’s install build tools, docker and docker-compose by entering the following commands and executing them:

sudo apt update && sudo apt upgrade -y
sudo apt install -y curl git jq lz4 build-essential screen

# Install Docker
curl -fsSL https://get.docker.com/ | sh
docker --version

# Install Docker-Compose
sudo curl -L "https://github.com/docker/compose/releases/download/v2.24.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

Let’s clone the starter repository and install the Infernet SDK:

# Clone Ritual's repository
git clone https://github.com/ritual-net/infernet-container-starter
cd infernet-container-starter/

screen -S ritual
project=hello-world make deploy-container

Do not close this session of the Powershell, open a second one, re-login and now edit the configuration file config.json by providing the correct coordinator address created on Base L2, the HTTPS URL provided by Alchemy (Base L2) and your private key preceded by 0x.

Use a new wallet, created for the node operator, do not use pre-existing wallets that you use to store your crypto.

nano ~/infernet-container-starter/deploy/config.json


coordinator_address: 0x8d871ef2826ac9001fb2e33fdd6379b6aabf449c
rpc_url: Base Mainnet HTTPS URL from Alchemy Dashboard
private key: 0x, followed by your Metamask private key

Deposit ~0.0035 ETH on this wallet on Base L2 network., visit basescan website, at the following address, click on Connect to Web3 and connect your wallet to basescan. Then:

  • registerNode, enter your own wallet’s address and click Write;

  • wait an hour and activate your node, click activateNode and click Write.

Go back to the 2nd terminal tab and edit Makefile and Deploy.s.sol files as showed here below:

# Edit Makefile
nano infernet-container-starter/projects/hello-world/contracts/Makefile

sender = <0x, followed by your Metamask private key>
RPC_URL = <Base Mainnet HTTPS URL from Alchemy Dashboard>


# Edit Deploy.s.sol
nano infernet-container-starter/projects/hello-world/contracts/script/Deploy.s.sol

address coordinator = 0x8D871Ef2826ac9001fB2e33fDD6379b6aaBF449c

Now launch the deploy container command:

cd infernet-container-starter/
make deploy-container project=hello-world

Do not close the two tabs of Powershell but open a 3rd one and install Foundry and dependencies. Foundry is a portable and modular toolkit for Ethereum applications written in Rust.

# Install Foundry in a new directory
mkdir foundry
cd foundry
curl -L https://foundry.paradigm.xyz | bash
source ~/.bashrc
foundryup

cd ~/infernet-container-starter/projects/hello-world/contracts
forge install --no-commit foundry-rs/forge-std
forge install --no-commit ritual-net/infernet-sdk
cd ../../../

Now deploy a consumer contract to interact with the Infernet SDK, Ritual Network provides an example contract, “SaysGM”: it requests a compute output from an Infernet Node and prints the result using the forge console.

Launch the following command and check the logs:

make deploy-contracts project=hello-world

# == Logs ==
# Loaded deployer: YOUR_ADDRESS
# deployed SaysHello: CONTRACT_DEPLOYED

Copy your CONTRACT_DEPLOYED and edit the SaysGM address in the following file:

nano projects/hello-world/contracts/script/CallContract.s.sol

# SaysGM saysGm = SaysGM(<CONTRACT_DEPLOYED>);

Save and exit, now launch the last command:

make call-contract project=hello-world

Check your node address on basescan, if you see the following txs made successfully, you launched everything correctly!

Congratulations, you have successfully completed the installation of your node!

The Ritual Network team has not confirmed any airdrops, however they invite users to test their product for themselves. Therefore, I invite the more experienced users, especially those more knowledgeable on the topic of artificial intelligence, to test Infernet SDK.

If you like my work, I suggest you to subscribe and mint the entry in order to support my work. The cost is insignificant for you, but it helps me to know that you like this kind of content.

Subscribe to 0xOuterGod
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.