Files
aitbc/cli/commands/edge.py
aitbc 149fbb0abe
Some checks failed
CLI Tests / test-cli (push) Failing after 11s
Cross-Node Transaction Testing / transaction-test (push) Successful in 2s
Deploy to Testnet / deploy-testnet (push) Successful in 1m9s
Documentation Validation / validate-docs (push) Failing after 10s
Documentation Validation / validate-policies-strict (push) Successful in 4s
Integration Tests / test-service-integration (push) Successful in 2m38s
Multi-Node Stress Testing / stress-test (push) Successful in 2s
Node Failover Simulation / failover-test (push) Successful in 2s
Package Tests / Python package - aitbc-agent-sdk (push) Failing after 27s
Security Scanning / security-scan (push) Has been cancelled
Package Tests / Python package - aitbc-core (push) Successful in 13s
Package Tests / Python package - aitbc-crypto (push) Successful in 9s
Package Tests / Python package - aitbc-sdk (push) Successful in 11s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 8s
Package Tests / JavaScript package - aitbc-token (push) Successful in 27s
Python Tests / test-python (push) Failing after 1m25s
Delegate Click commands to click_cli and add agent subcommands
- Route Click commands (agent, ipfs, oracle, etc.) to click_cli module
- Add zk, knowledge, bounty, dispute subcommands to agent group
- Add AI test submission, power trading, and reputation commands
- Add cross-chain transfer and listing commands
- Add monitor start/stop/status/alerts commands
- Add swarm create/discover/add/distribute/status commands
- Update main() to check command type and delegate appropriately
- Fix genesis CLI
2026-05-08 10:43:53 +02:00

67 lines
1.5 KiB
Python

"""Edge computing commands for AITBC CLI"""
import click
import json
from utils import output, error, success, warning
@click.group()
def edge():
"""Edge computing commands"""
pass
@edge.command()
@click.option("--name", required=True, help="Edge node name")
@click.option("--location", help="Edge node location")
@click.option("--capacity", type=int, help="Computing capacity")
def init(name: str, location: str, capacity: int):
"""Initialize edge node"""
import uuid
output({
"edge_id": f"edge_{uuid.uuid4().hex[:16]}",
"name": name,
"location": location or "unknown",
"capacity": capacity or 10,
"status": "initialized"
})
@edge.command()
@click.option("--edge-id", help="Edge node ID")
def status(edge_id: str):
"""Get edge node status"""
output({
"edge_id": edge_id or "all",
"status": "active",
"capacity_used": 0,
"tasks_running": 0
})
@edge.command()
def list():
"""List all edge nodes"""
output({
"nodes": [],
"total": 0
})
@edge.command()
@click.option("--edge-id", required=True, help="Edge node ID")
@click.option("--config", help="Configuration as JSON")
def configure(edge_id: str, config: str):
"""Configure edge node"""
import json
try:
config_data = json.loads(config) if config else {}
except:
config_data = {}
output({
"edge_id": edge_id,
"config": config_data,
"status": "configured"
})