Skip to content

Commit

Permalink
Fix chia farm summary aborting early if no local full node present
Browse files Browse the repository at this point in the history
Before 2.0, even if no local full node was present, `chia farm summary`
would still show useful information:

	$ chia farm summary
	Farming status: Not available
	Local Harvester
	   1 plots of size: 101.320 GiB on-disk, 101.400 GiBe (effective)
	Plot count for all harvesters: 1
	Total size of plots: 101.320 GiB, 101.400 GiBe (effective)
	Estimated network space: Unknown
	Expected time to win: Unknown
	For details on farmed rewards and fees you should run 'chia start wallet' and 'chia wallet show'

However, since 2.0, that is no longer the case. `chia farm summary`
simply aborts with an exception:

	$ chia farm summary
	Error: Connection error: ClientConnectorError: Cannot connect to host localhost:8555 ssl:<ssl.SSLContext object at 0x7fe0edd533c0> [Connect call failed ('127.0.0.1', 8555)]
	Check if full node rpc is running at 8555
	This is normal if full node is still starting up

This fixes this particular regression which is rather annoying for
farmers farming to a remote node.

Fixes #16164. Related to issue #9615, but that issue is wider in scope.
  • Loading branch information
xearl4 committed Sep 22, 2023
1 parent 719942d commit a93ff99
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion chia/cmds/farm_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ async def summary(
root_path: Path = DEFAULT_ROOT_PATH,
) -> None:
harvesters_summary = await get_harvesters_summary(farmer_rpc_port, root_path)
blockchain_state = await get_blockchain_state(rpc_port, root_path)
try:
blockchain_state = await get_blockchain_state(rpc_port, root_path)
except Exception:
blockchain_state = None
farmer_running = False if harvesters_summary is None else True # harvesters uses farmer rpc too

wallet_not_ready: bool = False
Expand Down

0 comments on commit a93ff99

Please sign in to comment.