- Prerequisites
- Full Development Setup
- Docker Compose Setup
- Running a Worker Node
- Remote GPU Development
- Stopping Services
Before running Prime Protocol, ensure you have the following requirements:
- Docker Desktop - Container runtime
- Git - Version control
- Rust - Programming language and toolchain
- Redis - In-memory data store
- Foundry - Smart contract development toolkit
- tmuxinator - Terminal session manager
git clone https://github.com/PrimeIntellect-ai/protocol.git
cd protocol
git submodule update --init --recursive
# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
# Reload .bashrc (or .bash_profile, depends on the system)
source ~/.bashrc
foundryup
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install cargo-watch
cargo install cargo-watch
# Install Redis (MacOS)
brew install redis
# Install Redis (Ubuntu)
sudo apt-get install redis-server
# Install Ruby (MacOS)
brew install ruby
# Install Ruby (Ubuntu)
sudo apt-get install ruby
# Install tmuxinator (do not use brew)
gem install tmuxinator
# Install Tmux (MacOS)
brew install tmux
# Install Tmux (Ubuntu)
sudo apt install tmux
sudo apt-get install libssl-dev
- Enable "Allow the default Docker socket to be used" in Docker Desktop settings (MacOS)
- On Ubuntu, add your user to the docker group:
sudo usermod -aG docker $USER
- Create
.env
files in base folder and discovery folder
make up
This will start:
- Local blockchain node
- Discovery service
- Validator node
- Orchestrator service
- Redis instance
- Supporting infrastructure
You can run all supporting services (chain, validator, discovery, orchestrator) in docker compose.
-
Start docker compose:
docker compose up
-
Run Setup:
make setup
-
Launch a worker:
- Adjust the .env var
WORKER_EXTERNAL_IP
to:WORKER_EXTERNAL_IP=host.docker.internal
- Launch the worker using
make watch-worker
- Whitelist the worker once you see the whitelist alert using:
make whitelist-provider
- Adjust the .env var
Once the core services are running, you can start a worker node in a new terminal:
make watch-worker
The worker will automatically connect to the discovery service and begin processing tasks. It takes a couple of seconds until the worker is whitelisted. This is done using a simple loop on the second page of tmux.
You can find more details on the APIs in the orchestrator and discovery service directory.
⚠️ IMPORTANT: The video shows the whitelist process happening automatically. Currently, this must be done manually using the commandmake whitelist-provider
.
remote_gpu_small.mp4
Start the local development environment:
make up
Set up your remote GPU worker:
- Provision a GPU instance and ensure Docker is installed
- Configure environment variables and start the remote worker:
SSH_CONNECTION="ssh your-ssh-conn string" EXTERNAL_IP="your-external-ip" make remote-worker
To gracefully shutdown all services:
make down