Commit Graph

67 Commits

Author SHA1 Message Date
oib
d8a432ce33 feat: complete phase 3 developer ecosystem and dao governance 2026-02-28 23:24:26 +01:00
oib
5bc18d684c feat: add phase 2 decentralized memory python services and tests 2026-02-28 23:19:02 +01:00
oib
c63259ef2c feat: finish phase 2 decentralized memory and storage tasks 2026-02-28 23:18:56 +01:00
oib
bf95cd0d9b feat: complete remaining phase 1 tasks - multi-chain wallet, atomic swaps, and multi-region deployment 2026-02-28 23:11:55 +01:00
oib
0e6c9eda72 feat(coordinator-api): integrate dynamic pricing engine with GPU marketplace and add agent identity router
- Add DynamicPricingEngine and MarketDataCollector dependencies to GPU marketplace endpoints
- Implement dynamic pricing calculation for GPU registration with market_balance strategy
- Calculate real-time dynamic prices at booking time with confidence scores and pricing factors
- Enhance /marketplace/pricing/{model} endpoint with comprehensive dynamic pricing analysis
  - Add static vs dynamic price
2026-02-28 22:57:10 +01:00
oib
85ae21a568 refactor(blockchain-explorer): add HTTPException import for error handling
- Import HTTPException from fastapi for proper exception handling in endpoints
- Prepare for enhanced error responses in blockchain explorer API routes
2026-02-28 22:04:46 +01:00
oib
12df88d196 fix(blockchain-explorer): fix template formatting and enhance health check endpoint
- Fix CSS animation syntax in HTML template by escaping curly braces for proper f-string formatting
- Replace .format() with .replace() for node_url substitution to avoid KeyError with unescaped braces
- Add blockchain node connectivity test to health check with 5s timeout
- Return degraded status when node is unreachable instead of error
- Add node_status field and API endpoints documentation to health response
2026-02-28 21:58:53 +01:00
oib
2d97783fb1 refactor(coordinator-api,blockchain-explorer): add response caching and fix timestamp handling
- Add cached decorator to admin stats, job status, payment status, and marketplace stats endpoints
- Configure cache TTLs using get_cache_config for different endpoint types (1min job_list, 30s user_balance, marketplace_stats)
- Import cache_management router and include it in main app with /v1 prefix
- Fix blockchain-explorer formatTimestamp to handle both ISO string and Unix numeric timestamps with type
2026-02-28 21:50:25 +01:00
oib
93ffaf53de feat(coordinator-api): add database connection pooling configuration and comprehensive payment validation
- Add configurable database connection pool settings (pool_size, max_overflow, pool_recycle, pool_pre_ping, echo)
- Replace hardcoded pool settings with environment-configurable values from settings
- Add QueuePool explicitly to both sync and async database engines
- Implement comprehensive Pydantic validators for payment schemas (JobPaymentCreate, PaymentRequest, ExchangePaymentRequest)
- Add regex
2026-02-28 21:35:58 +01:00
oib
57b12a882a refactor(coordinator-api): enhance startup/shutdown logging and add rate limit metrics endpoint
- Add database connection warmup during startup with connectivity test
- Expand startup logging with comprehensive configuration summary including all rate limits
- Implement graceful shutdown sequence with in-flight request handling and resource cleanup
- Add Prometheus metrics for rate limiting (hits counter and response time histogram)
- Create dedicated /rate-limit-metrics endpoint for rate limit monitoring
- Record
2026-02-28 21:29:08 +01:00
oib
2ec1ceb600 refactor(coordinator-api): make rate limits configurable via environment variables
- Add configurable rate limit settings for all endpoints (jobs, miner, admin, marketplace, exchange)
- Replace hardcoded rate limit decorators with lambda functions reading from settings
- Add rate limit configuration logging during startup
- Implement custom RateLimitExceeded exception handler with structured error responses
- Add enhanced shutdown logging for database cleanup and resource management
- Set default rate
2026-02-28 21:25:46 +01:00
oib
f05195749c feat(coordinator-api): add global exception handler and rate limiting to marketplace and exchange endpoints
- Add general exception handler to catch all unhandled exceptions with structured error responses
- Add structured logging to validation error handler with request context
- Implement slowapi rate limiting on marketplace endpoints (100/min list, 50/min stats, 30/min bid)
- Implement slowapi rate limiting on exchange payment creation (20/min)
- Add Request parameter to rate-limited endpoints for slow
2026-02-28 21:22:37 +01:00
oib
7cb0b30dae refactor: migrate all remaining modules to use shared aitbc.logging from aitbc-core package
- Replace `import logging` with `from aitbc.logging import get_logger` across blockchain-node scripts and coordinator-api modules
- Update logger initialization from `logging.getLogger(__name__)` to `get_logger(__name__)` in 30+ files
- Add production configuration validators for API keys, HMAC secret, and JWT secret in coordinator config
- Enhance coordinator startup with comprehensive initialization logging
2026-02-28 21:17:53 +01:00
oib
f6ee77f497 refactor: consolidate logging to shared aitbc-core package and upgrade database dependencies
- Upgrade SQLAlchemy to 2.0.47 with asyncio extras in blockchain-node and coordinator-api
- Add asyncpg >=0.29.0 for PostgreSQL async support
- Remove uvloop as optional dependency, make it required >=0.22.0
- Delete duplicate logger.py from blockchain-node (117 lines)
- Refactor coordinator-api logging to use shared aitbc.logging from aitbc-core package
- Add aitbc-core package dependency to coordinator
2026-02-28 21:09:14 +01:00
oib
d152044c6f chore: upgrade package.json engines to Node >=22.22.0 across all packages 2026-02-27 22:48:30 +01:00
oib
864ef4343e refactor(contracts): remove deprecated AIPowerRental contract in favor of bounty system
- Delete AIPowerRental.sol (566 lines) - replaced by AgentBounty.sol
- Remove rental agreement system with provider/consumer model
- Remove performance metrics and SLA tracking
- Remove dispute resolution mechanism
- Remove ZK-proof verification for performance
- Remove provider/consumer authorization system
- Bounty system provides superior developer incentive structure
2026-02-27 21:46:54 +01:00
oib
a477681c4b feat(developer-ecosystem): implement bounty and staking system with ZK-proof integration
Phase 1 Implementation Complete:
- AgentBounty.sol: Automated bounty board with ZK-proof verification
- AgentStaking.sol: Reputation-based yield farming with dynamic APY
- BountyIntegration.sol: Cross-contract event handling and auto-verification
- Database models: Complete bounty, staking, and ecosystem metrics schemas
- REST APIs: Full bounty and staking management endpoints
- Services: Business logic for bounty creation, verification, and staking operations
- Ecosystem dashboard: Analytics and metrics tracking system

Key Features:
- Multi-tier bounty system (Bronze, Silver, Gold, Platinum)
- Performance-based APY calculation with reputation multipliers
- ZK-proof integration with PerformanceVerifier.sol
- Automatic bounty completion detection
- Comprehensive analytics dashboard
- Risk assessment and leaderboards
- Real-time metrics and predictions

Security Features:
- Reentrancy protection on all contracts
- Role-based access control
- Dispute resolution mechanism
- Early unbonding penalties
- Platform fee collection

Economic Model:
- Creation fees: 0.5%
- Success fees: 2%
- Platform fees: 1%
- Staking APY: 5-20% based on performance
- Dispute fees: 0.1%
2026-02-27 17:51:23 +01:00
oib
27e836bf3f refactor(coordinator): standardize database path to follow blockchain-node pattern
- Change coordinator database from /opt/data/coordinator.db to ./data/coordinator.db
- Update config.py to use relative path consistent with blockchain-node
- Update deployment scripts to use /opt/coordinator-api/data/coordinator.db
- Add data directory creation in init_db() for consistency
- Update .env.example files to reflect new standard
- Maintain backward compatibility for production deployment
2026-02-27 17:32:00 +01:00
oib
d023654e74 refactor(theme): remove light theme and enforce dark mode across all apps 2026-02-27 14:00:33 +01:00
oib
e5092f2e83 fix(exchange): remove duplicate initializeTheme call and fix broken api route references 2026-02-27 12:55:26 +01:00
oib
e6094c9757 fix(website): inject font-awesome css to sub-apps to render the header cube logo 2026-02-27 12:42:10 +01:00
oib
9e70134494 fix(website): lock max-width to 1160px globally for header and containers 2026-02-27 12:36:51 +01:00
oib
37bdc7d034 fix(website): lock global header height to 90px and remove duplicate marketplace nav button 2026-02-27 12:25:21 +01:00
oib
2b6ac4a0bb fix(website): ensure data-theme='dark' is present on html tags across all apps for correct header rendering 2026-02-27 12:14:05 +01:00
oib
8587a9f2b5 fix(explorer): unify header and dark mode theme with global standard 2026-02-27 12:09:11 +01:00
oib
df726f9ccb fix(marketplace): resolve duplicate stats-grid element breaking stats rendering 2026-02-27 12:00:22 +01:00
oib
db63a008f4 fix(marketplace): unify header with global site header 2026-02-27 11:52:04 +01:00
oib
f3ab29a981 fix(exchange): unify header, match global theme, and fix broken API fallback/links 2026-02-27 11:48:41 +01:00
oib
c5af4819ff fix: change explorer port to 3001 and add systemd service configuration 2026-02-26 23:42:23 +01:00
oib
dd5c7f0e22 fix: resolve explorer transaction search, timestamp formatting, and optimize RPC total_count queries 2026-02-26 23:26:59 +01:00
oib
7bb2905cca Update database paths and fix foreign key references across coordinator API
- Change SQLite database path from `/home/oib/windsurf/aitbc/data/` to `/opt/data/`
- Fix foreign key references to use correct table names (users, wallets, gpu_registry)
- Replace governance router with new governance and community routers
- Add multi-modal RL router to main application
- Simplify DEPLOYMENT_READINESS_REPORT.md to focus on production deployment status
- Update governance router with decentralized DAO voting
2026-02-26 19:32:06 +01:00
oib
825f157749 Update Python version requirements and fix compatibility issues
- Bump minimum Python version from 3.11 to 3.13 across all apps
- Add Python 3.11-3.13 test matrix to CLI workflow
- Document Python 3.11+ requirement in .env.example
- Fix Starlette Broadcast removal with in-process fallback implementation
- Add _InProcessBroadcast class for tests when Starlette Broadcast is unavailable
- Refactor API key validators to read live settings instead of cached values
- Update database models with explicit
2026-02-24 18:41:08 +01:00
oib
938ced2e27 Fix npm CI error in GitHub Actions
- Remove package-lock.json from gitignore to enable npm ci
- Add package-lock.json for explorer-web app
- Update publish-packages.yml workflow
2026-02-24 17:47:45 +01:00
oib
82bbe5cb54 docs: simplify README to focus on core value proposition and remove obsolete trade-exchange HTML
- Rewrite README overview to emphasize decentralized GPU marketplace concept over technical implementation details
- Condense architecture section from detailed component listing to high-level flow diagram
- Remove directory structure table and consolidate documentation links
- Streamline quick start section by removing redundant deployment/test instructions
- Delete unused `apps/trade-exchange/index
2026-02-22 21:55:44 +01:00
oib
6901e0084f docs/config/packages: add v0.1 release prep, security status, and SDK enhancements
- Add Stage 23 roadmap for v0.1 release preparation with PyPI/npm publishing, deployment automation, and security audit milestones
- Document competitive differentiators: zkML/FHE integration, hybrid TEE/ZK verification, on-chain model marketplace, and geo-low-latency matching
- Update security documentation with smart contract audit results (0 vulnerabilities, 35 OpenZeppelin warnings)
- Add security-first setup
2026-02-19 21:47:28 +01:00
oib
421191ccaf feat: add transaction hash search to blockchain explorer and cleanup settlement storage
Blockchain Explorer:
- Add transaction hash search support (64-char hex pattern validation)
- Fetch and display transaction details in modal (hash, type, from/to, amount, fee, block)
- Fix regex escape sequence in block height validation
- Update search placeholder text to mention both search types
- Add blank lines between function definitions for PEP 8 compliance

Settlement Storage:
- Add timedelta import for future
2026-02-17 14:34:12 +01:00
oib
31d3d70836 feat: add blockchain RPC blocks-range endpoint and marketplace bid listing
Blockchain Node:
- Replace /blocks (pagination) with /blocks-range (height range query)
- Add start/end height parameters with 1000-block max range validation
- Return blocks in ascending height order instead of descending
- Update metrics names (rpc_get_blocks_range_*)
- Remove total count from response (return start/end/count instead)

Coordinator API:
- Add effective_url property to DatabaseConfig (SQLite/PostgreSQL defaults
2026-02-16 22:54:08 +01:00
oib
fdc3012780 feat: add skeleton loaders to marketplace and integrate global header across docs
Marketplace:
- Add skeleton loading states for stats grid and GPU offer cards
- Show animated skeleton placeholders during data fetch
- Add skeleton CSS with shimmer animation and dark mode support
- Wrap stats section in #stats-grid container for skeleton injection

Trade Exchange:
- Replace inline header with data-global-header component
- Switch GPU offers to production API (/api/miners/list)
- Add fallback to demo
2026-02-15 20:44:04 +01:00
oib
7062b2cc78 feat: add dark mode, navigation, and Web Vitals tracking to marketplace
Backend:
- Simplify DatabaseConfig: remove effective_url property and project root finder
- Update to Pydantic v2 model_config (replace nested Config class)
- Add web_vitals router to main.py and __init__.py
- Fix ExplorerService datetime handling (ensure timezone-naive comparisons)
- Fix status_label extraction to handle both enum and string job states

Frontend (Marketplace):
- Add dark mode toggle with system preference detection
2026-02-15 19:02:51 +01:00
oib
72e21fd07f feat: show Ollama plugin badge and available LLM models on marketplace cards
Backend:
- Add attributes field to MarketplaceOfferView schema
- Include attributes in _to_offer_view() response

Frontend:
- Add attributes type with Ollama fields to OfferRecord
- Show purple 'Ollama' plugin badge on cards with models
- Display available LLM model tags (gemma3, deepseek-r1, etc.)
- Add plugin-badge and model-tag CSS styles
2026-02-14 16:57:15 +01:00
oib
417259171a feat: marketplace GPU spec cards with VRAM, CUDA, region, pricing
- Add GPU fields to OfferRecord type (gpu_model, gpu_memory_gb, etc.)
- Replace flat table with responsive GPU offer cards
- Show GPU model, VRAM, GPU count, CUDA version, capacity specs
- Display pricing and SLA with provider + region
- Add offer-card CSS with spec grid, hover effects, responsive layout
2026-02-14 16:52:17 +01:00
oib
182e8572fa fix: remove /v1 from marketplace API fetch paths
nginx /api/ already maps to /v1/, so fetch paths should be
/api/marketplace/* not /api/v1/marketplace/* (double prefix)
2026-02-14 16:48:38 +01:00
oib
ba638c3905 feat: switch marketplace to production mode with real GPU offer
Coordinator API:
- Fix MarketplaceService.list_offers() to query DB instead of mock data
- Remove duplicate mock /marketplace/offers endpoint from marketplace_offers.py
- Handle status as string or enum in _to_offer_view()
- Deploy updated domain model with GPU columns to container
- Add GPU columns to marketplaceoffer table in production DB
- Register RTX 4060 Ti 16GB (at1-localhost) as marketplace offer

Marketplace Web:
- Create .env.production (VITE_MARKETPLACE_DATA_MODE=live, API=/api)
- Create vite.config.ts with base: '/marketplace/'
- Rebuild and deploy to server
2026-02-14 16:46:48 +01:00
oib
a13f5ed187 fix: marketplace asset paths and add vite.config.ts
- Fix dist/index.html: absolute /assets/ → relative assets/ paths
- Create vite.config.ts with base: '/marketplace/' for future builds
- Deploy mock data and vite.svg to server root for current build compat
2026-02-14 16:35:33 +01:00
oib
06e48ef34b chore: standardize configuration, logging, and error handling across blockchain node and coordinator API
- Add infrastructure.md and workflow files to .gitignore to prevent sensitive info leaks
- Change blockchain node mempool backend default from memory to database for persistence
- Refactor blockchain node logger with StructuredLogFormatter and AuditLogger (consistent with coordinator)
- Add structured logging fields: service, module, function, line number
- Unify coordinator config with Database
2026-02-13 22:39:43 +01:00
oib
de5b0f2696 refactor: replace requests with httpx in Bitcoin wallet and blockchain services
- Replace requests.Session with httpx.Client in BitcoinWallet class
- Add graceful fallback when httpx is not available with HTTP_CLIENT_AVAILABLE flag
- Add session null check in _rpc_call to prevent errors when httpx unavailable
- Update get_balance in blockchain service to use httpx.Client context manager
- Add warning log when httpx import fails to disable wallet functions
2026-02-13 16:10:57 +01:00
oib
c984a1e052 chore: enhance security configuration across applications
- Add root-level *.json to .gitignore to prevent wallet backup leaks
- Replace wildcard CORS origins with explicit localhost URLs across all apps
- Add OPTIONS method to CORS allowed methods for preflight requests
- Update coordinator database to use absolute path in data/ directory to prevent duplicates
- Add JWT secret validation in coordinator config (must be set via environment)
- Replace deprecated get_session dependency with Session
2026-02-13 16:07:03 +01:00
oib
65b63de56f docs: update README with comprehensive test results, CLI documentation, and enhanced feature descriptions
- Update key capabilities to include GPU marketplace, payments, billing, and governance
- Expand CLI section from basic examples to 12 command groups with 90+ subcommands
- Add detailed test results table showing 208 passing tests across 6 test suites
- Update documentation links to reference new CLI reference and coordinator API docs
- Revise test commands to reflect actual test structure (
2026-02-12 20:58:21 +01:00
oib
5120861e17 feat: add GPU-specific fields to marketplace offers and create dedicated GPU marketplace router
- Add GPU fields (model, memory, count, CUDA version, price, region) to MarketplaceOffer model
- Create new marketplace_gpu router for GPU-specific operations
- Update offer sync to populate GPU fields from miner capabilities
- Move GPU attributes from generic attributes dict to dedicated fields
- Update MarketplaceOfferView schema with GPU fields
- Expand CLI README with comprehensive documentation and
2026-02-12 19:08:17 +01:00
oib
15675390ac security: remove all hardcoded API keys, require from environment 2026-02-11 21:33:18 +01:00