Files
aitbc/scripts/add-agent.sh
aitbc 4f1fdbf3a0 feat: launch AITBC agent economy operations
 Agent Economy Live Operations
- Agent registry with 6 active agents
- Job marketplace with 4 active jobs (2445.38 AITBC total budget)
- Economic system with 1M AITBC supply and 100K reward pool
- Agent capabilities: text_generation, data_analysis, research

 Operational Tools
- add-agent.sh: Register new AI agents
- create-job.sh: Post jobs to marketplace
- list-agents.sh: View all registered agents
- list-jobs.sh: View all marketplace jobs
- agent-dashboard.sh: Real-time agent economy monitoring

 Production Ready
- Multi-node mesh network operational
- Agent economy infrastructure deployed
- Smart contract framework ready
- Economic incentives configured

🚀 Next Phase: Agent Applications & Job Matching
- Ready for agent job applications
- Escrow system implementation
- Reward distribution activation
- Agent reputation system

🎉 AITBC Mesh Network + Agent Economy = FULLY OPERATIONAL!
2026-04-02 12:26:59 +02:00

108 lines
2.9 KiB
Bash
Executable File

#!/bin/bash
# ============================================================================
# AITBC Mesh Network - Add Agent Script
# ============================================================================
set -e
# Colors for output
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
AITBC_ROOT="${AITBC_ROOT:-/opt/aitbc}"
VENV_DIR="$AITBC_ROOT/venv"
PYTHON_CMD="$VENV_DIR/bin/python"
# Get arguments
AGENT_NAME="$1"
CAPABILITY="$2"
if [[ -z "$AGENT_NAME" || -z "$CAPABILITY" ]]; then
echo -e "${YELLOW}Usage: $0 <agent_name> <capability>${NC}"
echo ""
echo "Available capabilities:"
echo " - text_generation"
echo " - data_analysis"
echo " - image_processing"
echo " - trading"
echo " - research"
exit 1
fi
# Validate capability
VALID_CAPABILITIES=("text_generation" "data_analysis" "image_processing" "trading" "research")
if [[ ! " ${VALID_CAPABILITIES[@]} " =~ " ${CAPABILITY} " ]]; then
echo -e "${RED}Error: Invalid capability '$CAPABILITY'${NC}"
echo "Valid capabilities: ${VALID_CAPABILITIES[*]}"
exit 1
fi
echo -e "${BLUE}🤖 Adding New Agent${NC}"
echo "=================="
echo "Name: $AGENT_NAME"
echo "Capability: $CAPABILITY"
echo ""
# Add agent
cd "$AITBC_ROOT"
"$PYTHON_CMD" -c "
import sys
import json
import time
import random
# Load agent registry
with open('/opt/aitbc/data/agent_registry.json', 'r') as f:
registry = json.load(f)
# Generate unique agent address
agent_id = registry['total_agents'] + 1
agent_address = f'0xagent_{agent_id:03d}'
# Create new agent
new_agent = {
'address': agent_address,
'name': '$AGENT_NAME',
'owner': f'0xowner_{agent_id:03d}',
'capabilities': '$CAPABILITY',
'reputation': 5.0,
'total_earnings': 0.0,
'jobs_completed': 0,
'success_rate': 1.0,
'stake': 1000.0,
'status': 'active',
'created_at': time.time()
}
# Add agent to registry
registry['agents'][agent_address] = new_agent
registry['capabilities']['$CAPABILITY'].append(agent_address)
registry['total_agents'] += 1
registry['active_agents'] += 1
registry['last_updated'] = time.time()
# Save updated registry
with open('/opt/aitbc/data/agent_registry.json', 'w') as f:
json.dump(registry, f, indent=2)
print(f'✅ Agent Added Successfully')
print(f' Address: {agent_address}')
print(f' Name: {new_agent[\"name\"]}')
print(f' Capability: {new_agent[\"capabilities\"]}')
print(f' Reputation: {new_agent[\"reputation\"]}')
print(f' Stake: {new_agent[\"stake\"]} AITBC')
print(f' Status: {new_agent[\"status\"]}')
"
echo ""
echo -e "${GREEN}🎉 Agent '$AGENT_NAME' has been added to the AITBC network!${NC}"
echo ""
echo -e "${BLUE}Next Steps:${NC}"
echo "1. View all agents: ./scripts/list-agents.sh"
echo "2. Create a job: ./scripts/create-job.sh <title> <budget>"
echo "3. View agent dashboard: ./scripts/agent-dashboard.sh"