Files
aitbc/scripts/agent/list-agents.sh
aitbc 3897bcbf24
Some checks failed
CLI Tests / test-cli (push) Failing after 4s
Deploy to Testnet / deploy-testnet (push) Successful in 1m40s
Documentation Validation / validate-docs (push) Failing after 12s
Documentation Validation / validate-policies-strict (push) Successful in 4s
Integration Tests / test-service-integration (push) Successful in 2m42s
Package Tests / Python package - aitbc-agent-sdk (push) Failing after 34s
Package Tests / Python package - aitbc-core (push) Successful in 27s
Package Tests / Python package - aitbc-crypto (push) Successful in 13s
Package Tests / Python package - aitbc-sdk (push) Successful in 16s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 8s
Package Tests / JavaScript package - aitbc-token (push) Successful in 18s
Python Tests / test-python (push) Failing after 50s
Security Scanning / security-scan (push) Failing after 43s
Multi-Node Stress Testing / stress-test (push) Successful in 12s
Cross-Node Transaction Testing / transaction-test (push) Successful in 9s
refactor: move version to separate module and improve logging
- Created aitbc/_version.py with centralized version definition
- Updated aitbc/__init__.py to import __version__ from _version module
- Updated constants.py to use __version__ for PACKAGE_VERSION
- Replaced print() calls with logger in decorators.py, events.py, queue_manager.py, and state.py
- Added logger initialization using get_logger(__name__) in config.py, decorators.py, events.py, queue_manager.py, and state.py
- Added cli/commands
2026-05-11 20:12:01 +02:00

57 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
# ============================================================================
# AITBC Mesh Network - List Agents Script
# ============================================================================
set -e
# Colors for output
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color
AITBC_ROOT="${AITBC_ROOT:-/opt/aitbc}"
VENV_DIR="$AITBC_ROOT/venv"
PYTHON_CMD="$VENV_DIR/bin/python"
echo -e "${BLUE}🤖 AITBC Agent Registry${NC}"
echo "======================"
cd "$AITBC_ROOT"
"$PYTHON_CMD" -c "
import sys
import json
import time
# Load agent registry
with open('/opt/aitbc/data/agent_registry.json', 'r') as f:
registry = json.load(f)
print(f'Total Agents: {registry[\"total_agents\"]}')
print(f'Active Agents: {registry[\"active_agents\"]}')
print(f'Last Updated: {time.strftime(\"%Y-%m-%d %H:%M:%S\", time.gmtime(registry[\"last_updated\"]))}')
print()
if registry['agents']:
print('Agent Details:')
print('=' * 80)
for i, (address, agent) in enumerate(registry['agents'].items(), 1):
print(f'{i}. {agent[\"name\"]}')
print(f' Address: {address}')
print(f' Capability: {agent[\"capabilities\"]}')
print(f' Reputation: {agent[\"reputation\"]}/5.0')
print(f' Jobs Completed: {agent[\"jobs_completed\"]}')
print(f' Total Earnings: {agent[\"total_earnings\"]:.2f} AITBC')
print(f' Stake: {agent[\"stake\"]:.2f} AITBC')
print(f' Status: {agent[\"status\"]}')
print(f' Created: {time.strftime(\"%Y-%m-%d %H:%M:%S\", time.gmtime(agent[\"created_at\"]))}')
print()
else:
print('No agents registered yet.')
print('Use: ./scripts/add-agent.sh <name> <capability> to add agents')
"