Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Various farm summary items do not work when using a remote node #9615

Open
Ealrann opened this issue Dec 18, 2021 · 11 comments
Open

[Bug] Various farm summary items do not work when using a remote node #9615

Ealrann opened this issue Dec 18, 2021 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@Ealrann
Copy link
Contributor

Ealrann commented Dec 18, 2021

What happened?

Setup

Long story short: my internet is slow, running a full node at home is too heavy to do it properly. Monitoring the network usage shows this bandwidth consumption:

Full node <-> others full node  : 100-300 kBps
Farmer <-> Full node            : 4  kBps
Harvesters <-> Farmer           : 50 kBps

So to optimize my setup, I moved the Full node only to a VPS, but I keep the Farmer at home:

           Home                 Internet              VPS
Harvesters <-> Farmer         <----------->        Full node

I just configure the full node address in the Farmer configuration, and it works.

This is my best setup so far (months of testing/monitoring). I win blocks, and the private key stays at home with the farmer (the full node on VPS doesn't need keys).

The issue

The only issue with this setup so far is the chia farm summary output :

$ chia farm summary
Connection error. Check if full node is running at 8555
Farming status: Not available
[...]
Estimated network space: Unknown
Expected time to win: Unknown

It properly shows the plot count and the harvesters (I hided this info here for privacy).
But the Farming status: Not available doesn't works even if:

  1. The farmer is connected to a full node (but no RPC).
  2. The farmer regularly receive challenges from the full node.

Less important, the Expected time to win: Unknown and Estimated network space are broken too.

Version

1.2.11

What platform are you using?

Linux

What ui mode are you using?

CLI

Relevant log output

No response

@Ealrann Ealrann added the bug Something isn't working label Dec 18, 2021
@JsBlueCat
Copy link

#9635 (comment)

@emlowe emlowe assigned emlowe and xdustinface and unassigned emlowe Jan 4, 2022
@emlowe emlowe changed the title [Bug] Distant Full-Node: "Farming status: Not available " [Bug] Various farm summary items do not work when using a remote node Apr 26, 2022
@emlowe
Copy link
Contributor

emlowe commented Apr 26, 2022

In various places in the farmer, the code specifically only looks for the node at the current self_hostname setting in config.yaml and for some reason ignores the setting for the node in the farmer section. See eg. get_blockchain_state in farm_funcs.py. This and others should get changed to use the farmer:full_node_peer settings

@Ealrann Ealrann changed the title [Bug] Various farm summary items do not work when using a remote node [Bug] Farmer with remote full_node : Various farm summary items do not work Apr 26, 2022
@Ealrann Ealrann changed the title [Bug] Farmer with remote full_node : Various farm summary items do not work [Bug] Various farm summary items do not work when using a remote node Apr 26, 2022
@Ealrann
Copy link
Contributor Author

Ealrann commented Apr 26, 2022

Oups, sorry for the title edit, I didn't see you changed it. Thank you for your attention on this issue 🙏🙏 !

@emlowe
Copy link
Contributor

emlowe commented Apr 26, 2022

It's not a common deployment model, so priority obviously hasn't been that high.

@Ealrann
Copy link
Contributor Author

Ealrann commented Apr 26, 2022

I understand, and the problem is really minor. If I can help with testing, let me know.
(btw, hurray for python 3.10 🌟 )

@wiryonolau
Copy link

wiryonolau commented Aug 30, 2023

In my case this no longer appear in 2.0.0, prior version appear and works normally

$ chia farm summary
Connection error. Check if full node is running at 8555
Farming status: Not available
[...]
Estimated network space: Unknown
Expected time to win: Unknown

It become this

$ chia farm summary
Error: Connection error: ClientConnectorError: Cannot connect to host 127.0.0.1:8555 ssl:<ssl.SSLContext object at 0x7f6a078b8340> [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

my setup is

harvester --- vpn----> farmer-only -----> node

There is only minimal overhead using vpn connection
farmer-only to node is using public ip.

@wiryonolau
Copy link

wiryonolau commented Aug 30, 2023

In various places in the farmer, the code specifically only looks for the node at the current self_hostname setting in config.yaml and for some reason ignores the setting for the node in the farmer section. See eg. get_blockchain_state in farm_funcs.py. This and others should get changed to use the farmer:full_node_peer settings

I've been searching for the change in the source code, diff between 1.8.0 and 2.0.0 but haven't found the change that cause this.

Doesn't see any related change in farm_funcs.py, this two file also no change chia/rpc/farmer_rpc_client.py and chia/rpc/rpc_client.py . Not sure where to looks , most of the change for farmer are typing related and code clean up.

I cannot update my node, so if there is open full node v2.0.0, I can help test by creating new farmer-only and redirect some of my harvester there.

When updating to 2.0.0 did you have a new config created for each device and also run the chia init [directory] command on each harvester?

Ah regarding this, I forget to mention if I change farmer-only to farmer ( farmer and full node ) on same config.yml and setup. It works directly

@wiryonolau
Copy link

wiryonolau commented Sep 5, 2023

Hi @emlowe is this the problem in chia/cmds/farm_funcs.py ?

async def get_blockchain_state(
    rpc_port: Optional[int], root_path: Path = DEFAULT_ROOT_PATH
) -> Optional[Dict[str, Any]]:
    config = load_config(root_path, "config.yaml")                                                                                       
    async with FullNodeRpcClient.create(config["farmer"]["full_node_peer"]["host"], config["farmer"]["full_node_peer"]["port"], path, config) as (client, _):
        return await client.get_blockchain_state()

Should we create additional FarmerFullNodeRpcClient in /cmds/cmds_util.py that load from farmer config instead of localhost

Or we can add in the full_node config.yaml to mark it as remote and use the ip instead of localhost ?

full_node:
  remote: someip / localhost

Can you point me which file that might cause the problem, I have trouble finding the function in the source code. This issue appear to be closed also, I got a lot of harvester and currently cannot move the node to the same server as farmer due to resource limit.

@BrandtH22
Copy link
Contributor

BrandtH22 commented Sep 11, 2023

Hi @emlowe is this the problem in chia/cmds/farm_funcs.py ?

async def get_blockchain_state(
    rpc_port: Optional[int], root_path: Path = DEFAULT_ROOT_PATH
) -> Optional[Dict[str, Any]]:
    config = load_config(root_path, "config.yaml")                                                                                       
    async with FullNodeRpcClient.create(config["farmer"]["full_node_peer"]["host"], config["farmer"]["full_node_peer"]["port"], path, config) as (client, _):
        return await client.get_blockchain_state()

Should we create additional FarmerFullNodeRpcClient in /cmds/cmds_util.py that load from farmer config instead of localhost

Or we can add in the full_node config.yaml to mark it as remote and use the ip instead of localhost ?

full_node:
  remote: someip / localhost

Can you point me which file that might cause the problem, I have trouble finding the function in the source code. This issue appear to be closed also, I got a lot of harvester and currently cannot move the node to the same server as farmer due to resource limit.

Hey @wiryonolau , I have seen you respond to a number of very old discussion messages with support questions but am not entirely sure what the issue or question is that you are facing.
Would you be able to create a new support discussion ticket and consolidate your questions and other data there for us to better assist?
Note - we generally can provide more immediate and thorough support in our discord server:
https://discord.gg/chia

(link to open a support discussion - https://github.com/Chia-Network/chia-blockchain/discussions/new?category=support)

@wiryonolau
Copy link

wiryonolau commented Sep 12, 2023

Hi @emlowe is this the problem in chia/cmds/farm_funcs.py ?

async def get_blockchain_state(
    rpc_port: Optional[int], root_path: Path = DEFAULT_ROOT_PATH
) -> Optional[Dict[str, Any]]:
    config = load_config(root_path, "config.yaml")                                                                                       
    async with FullNodeRpcClient.create(config["farmer"]["full_node_peer"]["host"], config["farmer"]["full_node_peer"]["port"], path, config) as (client, _):
        return await client.get_blockchain_state()

Should we create additional FarmerFullNodeRpcClient in /cmds/cmds_util.py that load from farmer config instead of localhost

Or we can add in the full_node config.yaml to mark it as remote and use the ip instead of localhost ?

full_node:
  remote: someip / localhost

Can you point me which file that might cause the problem, I have trouble finding the function in the source code. This issue appear to be closed also, I got a lot of harvester and currently cannot move the node to the same server as farmer due to resource limit.

Hey @wiryonolau , I have seen you respond to a number of very old discussion messages with support questions but am not entirely sure what the issue or question is that you are facing.
Would you be able to create a new support discussion ticket and consolidate your questions and other data there for us to better assist?
Note - we generally can provide more immediate and thorough support in our discord server:
https://discord.gg/chia

(link to open a support discussion - https://github.com/Chia-Network/chia-blockchain/discussions/new?category=support)

My issue is closed #16164 due to similar to this one

I explain the general problem there.
It's ok since version 1.3 to 1.8.1, 1.8.2 has other problem.
break on 2.0.0

xearl4 added a commit to xchdata/chia-blockchain that referenced this issue Sep 21, 2023
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 Chia-Network#16164. Related to issue Chia-Network#9615, but that issue is wider in scope.
xearl4 added a commit to xchdata/chia-blockchain that referenced this issue Sep 21, 2023
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 Chia-Network#16164. Related to issue Chia-Network#9615, but that issue is wider in scope.
xearl4 added a commit to xchdata/chia-blockchain that referenced this issue Sep 22, 2023
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 Chia-Network#16164. Related to issue Chia-Network#9615, but that issue is wider in scope.
xearl4 added a commit to xchdata/chia-blockchain that referenced this issue Sep 22, 2023
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 Chia-Network#16164. Related to issue Chia-Network#9615, but that issue is wider in scope.
xearl4 added a commit to xchdata/chia-blockchain that referenced this issue Sep 22, 2023
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 Chia-Network#16164. Related to issue Chia-Network#9615, but that issue is wider in scope.
xearl4 added a commit to xchdata/chia-blockchain that referenced this issue Sep 23, 2023
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 Chia-Network#16164. Related to issue Chia-Network#9615, but that issue is wider in scope.
wallentx pushed a commit that referenced this issue Sep 25, 2023
…16387)

* Fix `chia farm summary` aborting early if no local full node present

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.

* Improve exception reporting for `chia farm summary`

With this change, only the exceptions when failing to connect to a local
full node and/or wallet are suppressed, as these cases are already
properly handled by adjusted command output. Any other exception is
printed to stderr.
@wiryonolau
Copy link

wiryonolau commented Nov 10, 2023

Hi just migrate today, seems there is no longer any error in 2.1.1 for remote farm. Thanks @xchdata1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants