autonity / aut

A command-line RPC client for Autonity
MIT License
11 stars 10 forks source link

Don't fail `node info` when node doesn't have `admin` API enabled #150

Closed aiman closed 1 month ago

aiman commented 5 months ago

The node info command extracts various information from the node. Some of it requires information from admin_nodeInfo JSON-RPC endpoint.

But this admin endpoint may not always be enabled, especially in public nodes. In this case, calling node info will throw an exception:

$ admin node info
web3.exceptions.MethodUnavailable: {'code': -32601, 'message': 'the method admin_nodeInfo does not exist/is not available'}

Instead of failing due to error, the command should just display all available information. The help text should be updated to mention the admin API requirement. In the worst case a warning message could be shown on stderr that not all data could be queried, but this does not seem absolutely necessary.

aiman commented 1 month ago

Fixed in develop branch.