This guide provides instructions for deploying and managing tasks on the Prime Protocol network.
Before deploying tasks, ensure you have:
- All core services running (
make up
) - A worker node registered on the network
Start a local worker:
make watch-worker
Whitelist this local worker:
make whitelist-provider
Check that the worker has been registered with the orchestrator:
curl -X GET http://localhost:8090/nodes -H "Authorization: Bearer admin"
Successful response:
{
"nodes": [
{
"address": "0x66295e2b4a78d1cb57db16ac0260024900a5ba9b",
"ip_address": "0.0.0.0",
"port": 8091,
"status": "Healthy",
"task_id": null,
"task_state": null
}
],
"success": true
}
Deploy a simple task using the API:
curl -X POST http://localhost:8090/tasks \
-H "Content-Type: application/json" \
-H "Authorization: Bearer admin" \
-d '{"name":"sample","image":"ubuntu:latest"}'
Successful response:
{
"success": true,
"task": "updated_task"
}
Verify that the task is running:
curl -X GET http://localhost:8090/nodes -H "Authorization: Bearer admin"
Successful response:
{
"nodes": [
{
"address": "0x66295e2b4a78d1cb57db16ac0260024900a5ba9b",
"ip_address": "0.0.0.0",
"port": 8091,
"status": "Healthy",
"task_id": "29edd356-5c48-4ba6-ab96-73d002daddff",
"task_state": "RUNNING"
}
],
"success": true
}
Check that the Docker container is running:
docker ps
Example output:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e860c44a9989 ubuntu:latest "sleep infinity" 3 minutes ago Up 3 minutes prime-task-29edd356-5c48-4ba6-ab96-73d002daddff
ef02d23b5c74 redis:alpine "docker-entrypoint.s…" 27 minutes ago Up 27 minutes 0.0.0.0:6380->6379/tcp, [::]:6380->6379/tcp prime-worker-validator-redis-1
7761ee7b6dcf ghcr.io/foundry-rs/foundry:latest "anvil --host 0.0.0.…" 27 minutes ago Up 27 minutes 0.0.0.0:8545->8545/tcp, :::8545->8545/tcp prime-worker-validator-anvil-1