feat: migrate wallet daemon and CLI to use centralized aitbc package utilities
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Successful in 9s
CLI Tests / test-cli (push) Failing after 3s
Integration Tests / test-service-integration (push) Successful in 41s
Python Tests / test-python (push) Failing after 18s
Security Scanning / security-scan (push) Failing after 2m0s

- Migrate simple_daemon.py from mock data to real keystore and blockchain RPC integration
- Add httpx for async HTTP client in wallet daemon
- Implement real wallet listing from keystore directory
- Implement blockchain balance queries via RPC
- Update CLI to use aitbc.AITBCHTTPClient instead of requests
- Add aitbc imports: constants, http_client, exceptions, logging, paths, validation
- Add address and amount validation in
This commit is contained in:
aitbc
2026-04-24 22:05:55 +02:00
parent 154627cdfa
commit cbd8700984
13 changed files with 724 additions and 455 deletions

View File

@@ -13,6 +13,7 @@ import os
from pathlib import Path
from typing import Optional, Dict, Any
from aitbc.paths import get_keystore_path
from cryptography.fernet import Fernet
@@ -72,14 +73,14 @@ def get_private_key(address: str, password: Optional[str] = None,
with open(password_file) as f:
pass_password = f.read().strip()
if not pass_password:
pw_file = Path("/var/lib/aitbc/keystore/.password")
pw_file = get_keystore_path(".password")
if pw_file.exists():
pass_password = pw_file.read_text().strip()
if not pass_password:
raise ValueError(
"No password provided. Set KEYSTORE_PASSWORD, pass --password, "
"or create /var/lib/aitbc/keystore/.password"
"or create a .password file in the keystore directory"
)
# Load and decrypt keystore