Skip to content

Conversation

RezaRahemtola
Copy link
Member

@RezaRahemtola RezaRahemtola commented Jul 31, 2025

This PR implements the missing --json parameter that is in the option but not actually taken into account.
It displays with indentation the raw data, which can then be used by the user / parsed by automation scripts etc.

We could consider filtering this data in the future to reduce the amount of data displayed, some of which is probably irrelevant, but kept it simple for now.

Self proofreading checklist

  • The new code clear, easy to read and well commented.
  • New code does not duplicate the functions of builtin or popular libraries.
  • An LLM was used to review the new code and look for simplifications.
  • New classes and functions contain docstrings explaining what they provide.
  • All new code is covered by relevant tests.

How to test

Simply run aleph instance list --json with an account that has instances (or pass --address, for example with 0x501DD421f2B9F96E3e20945f42aeCBDd4A607a03

Print screen / video

image

@RezaRahemtola RezaRahemtola self-assigned this Jul 31, 2025
@RezaRahemtola RezaRahemtola added the BLUE This PR is simple and straightforward. label Jul 31, 2025
@RezaRahemtola RezaRahemtola force-pushed the reza/fix-instance-list-json branch from 772ca63 to 7234d7a Compare July 31, 2025 20:15
Copy link

Failed to retrieve llama text: POST 500: Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 980, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa
File "/usr/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection
raise exceptions[0]
File "/usr/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection
sock = await self._connect_sock(
File "/usr/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect
return await fut
File "/usr/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('::1', 8080, 0, 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/root/init1.py", line 406, in process_instruction
headers, body, output, output_data = await run_executable_http(
File "/root/init1.py", line 342, in run_executable_http
headers, body = await make_request(session, scope)
File "/root/init1.py", line 311, in make_request
async with session.request(
File "/usr/local/lib/python3.9/dist-packages/aiohttp/client.py", line 1141, in aenter
self._resp = await self._coro
File "/usr/local/lib/python3.9/dist-packages/aiohttp/client.py", line 536, in _request
conn = await self._connector.connect(
File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 540, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 901, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 988, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:8080 ssl:default [Connect call failed ('::1', 8080, 0, 0)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLUE This PR is simple and straightforward.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant