Add manual chain export/import RPC endpoints and fix chain_id in wallet adapter
Some checks failed
Integration Tests / test-service-integration (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
CLI Tests / test-cli (push) Has been cancelled

- Add /export-chain endpoint to export full blockchain state (blocks, accounts, transactions) as JSON
- Add /import-chain endpoint to import chain state with backup and data clearing
- Add /force-sync endpoint to trigger reorg by fetching and importing peer's chain state
- Fix duplicate import_block implementation (remove redundant async with _import_lock block)
- Fix wallet adapter to use chain_id=ait-testnet instead of ait
This commit is contained in:
aitbc
2026-04-13 22:41:28 +02:00
parent 9bfa27f518
commit 79516a4388
2 changed files with 239 additions and 1 deletions

View File

@@ -311,7 +311,7 @@ class DualModeWalletAdapter:
rpc_url = self.config.blockchain_rpc_url
try:
resp = httpx.get(f"{rpc_url}/rpc/getBalance/{from_address}?chain_id=ait-mainnet", timeout=5)
resp = httpx.get(f"{rpc_url}/rpc/account/{from_address}?chain_id=ait-testnet", timeout=5)
if resp.status_code == 200:
data = resp.json()
chain_balance = data.get("balance", 0)