Files
aitbc/dev/tests/test_scenario_b.sh
aitbc 40ddf89b9c
Some checks failed
CLI Tests / test-cli (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Documentation Validation / validate-docs (push) Has been cancelled
API Endpoint Tests / test-api-endpoints (push) Has been cancelled
docs: update CLI command syntax across workflow documentation
- Updated marketplace commands: `marketplace --action` → `market` subcommands
- Updated wallet commands: direct flags → `wallet` subcommands
- Updated AI commands: `ai-submit`, `ai-status` → `ai submit`, `ai status`
- Updated blockchain commands: `chain` → `blockchain info`
- Standardized command structure across all workflow files
- Affected files: MULTI_NODE_MASTER_INDEX.md, TEST_MASTER_INDEX.md, multi-node-blockchain-marketplace
2026-04-08 12:10:21 +02:00

83 lines
2.8 KiB
Bash
Executable File

#!/bin/bash
# Scenario B: Localhost GPU Client → aitbc1 Marketplace Test
echo "🚀 Scenario B: Localhost GPU Client → aitbc1 Marketplace"
echo "======================================================"
# Set up client1 environment
export CLIENT_ID="client1"
export CLIENT_WALLET="0xabcdef1234567890abcdef1234567890abcdef12"
export CLIENT_REGION="localhost"
echo "📋 Step 1: Check client1 wallet configuration"
echo "=========================================="
if [ -f "/home/oib/windsurf/aitbc/home/client1/client_wallet.json" ]; then
echo "✅ client1 wallet found:"
cat /home/oib/windsurf/aitbc/home/client1/client_wallet.json
else
echo "❌ client1 wallet not found"
fi
echo ""
echo "📋 Step 2: Verify aitbc1 marketplace connectivity"
echo "=========================================="
curl -s http://127.0.0.1:8015/v1/health | jq .
echo ""
echo "📋 Step 3: Wait for marketplace synchronization"
echo "=========================================="
echo "⏳ Waiting 30 seconds for miner1 registration to sync from aitbc to aitbc1..."
sleep 30
echo ""
echo "📋 Step 4: Discover available services on aitbc1"
echo "=========================================="
curl -s http://127.0.0.1:8015/v1/marketplace/offers | jq '.[] | select(.miner_id == "miner1")'
echo ""
echo "📋 Step 5: Client1 discovers GPU services"
echo "=========================================="
aitbc marketplace gpu discover \
--client-id $CLIENT_ID \
--region $CLIENT_REGION \
--marketplace-url "http://127.0.0.1:8015"
echo ""
echo "📋 Step 6: Client1 requests service from miner1 via aitbc1"
echo "=========================================="
aitbc marketplace gpu request \
--client-id $CLIENT_ID \
--miner-id "miner1" \
--model "gemma3:1b" \
--prompt "What is artificial intelligence?" \
--marketplace-url "http://127.0.0.1:8015"
echo ""
echo "📋 Step 7: Verify transaction on aitbc1"
echo "=========================================="
sleep 5
aitbc marketplace transactions $CLIENT_ID \
--marketplace-url "http://127.0.0.1:8015"
echo ""
echo "📋 Step 8: Test cross-container service routing"
echo "=========================================="
# This should route from client1 (localhost) → aitbc1 → aitbc → localhost miner1
curl -X POST http://127.0.0.1:8015/v1/gpu/inference \
-H "Content-Type: application/json" \
-d '{"miner_id": "miner1", "model": "gemma3:1b", "prompt": "Cross-container routing test"}' | jq .
echo ""
echo "📋 Step 9: Verify marketplace stats on both sites"
echo "=========================================="
echo "aitbc marketplace stats:"
curl -s http://127.0.0.1:8000/v1/marketplace/stats | jq '.total_offers, .active_miners'
echo ""
echo "aitbc1 marketplace stats:"
curl -s http://127.0.0.1:8015/v1/marketplace/stats | jq '.total_offers, .active_miners'
echo ""
echo "🎉 Scenario B Complete!"
echo "======================="