diff --git a/apps/blockchain-node/src/aitbc_chain/rpc/router.py b/apps/blockchain-node/src/aitbc_chain/rpc/router.py index 4cf54c7f..46d19220 100755 --- a/apps/blockchain-node/src/aitbc_chain/rpc/router.py +++ b/apps/blockchain-node/src/aitbc_chain/rpc/router.py @@ -314,7 +314,7 @@ async def get_mempool(chain_id: str = None, limit: int = 100) -> Dict[str, Any]: raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=f"Failed to get mempool: {str(e)}") -@router.get("/accounts/{address}", summary="Get account information") +@router.get("/account/{address}", summary="Get account information") async def get_account(address: str, chain_id: str = None) -> Dict[str, Any]: """Get account information""" chain_id = get_chain_id(chain_id) @@ -332,6 +332,12 @@ async def get_account(address: str, chain_id: str = None) -> Dict[str, Any]: } +@router.get("/accounts/{address}", summary="Get account information (alias)") +async def get_account_alias(address: str, chain_id: str = None) -> Dict[str, Any]: + """Get account information (alias endpoint)""" + return await get_account(address, chain_id) + + @router.get("/transactions", summary="Query transactions") async def query_transactions( transaction_type: Optional[str] = None, diff --git a/cli/aitbc_cli.py b/cli/aitbc_cli.py index 9e1050eb..b4d1a046 100755 --- a/cli/aitbc_cli.py +++ b/cli/aitbc_cli.py @@ -673,7 +673,7 @@ def get_balance(wallet_name: str, rpc_url: str = DEFAULT_RPC_URL) -> Optional[Di address = wallet_data["address"] # Get account info from RPC - response = requests.get(f"{rpc_url}/rpc/accounts/{address}") + response = requests.get(f"{rpc_url}/rpc/account/{address}?chain_id=ait-testnet") if response.status_code == 200: account_info = response.json() return { diff --git a/cli/commands/blockchain.py b/cli/commands/blockchain.py index 1b028a92..b97f9922 100755 --- a/cli/commands/blockchain.py +++ b/cli/commands/blockchain.py @@ -966,7 +966,7 @@ def balance(ctx, address, chain_id, all_chains): for chain in chains: try: response = client.get( - f"{_get_node_endpoint(ctx)}/rpc/getBalance/{address}?chain_id={chain}", + f"{_get_node_endpoint(ctx)}/rpc/account/{address}?chain_id={chain}", timeout=5 ) if response.status_code == 200: diff --git a/cli/commands/marketplace.py b/cli/commands/marketplace.py index a2e8a8f8..fa1c187f 100755 --- a/cli/commands/marketplace.py +++ b/cli/commands/marketplace.py @@ -240,7 +240,6 @@ def ollama_task(ctx, gpu_id: str, model: str, prompt: str, temperature: float, m else: error(f"Failed to submit Ollama task: {response.status_code} {response.text}") except Exception as e: - error(f"Ollama task submission failed: {e}") @gpu.command(name="pay")