Can I run CLI rpc command against another machine?

I’m curious with the new RPC command for the CLI, can I run a rpc command from my main machine to get a rpc endpoint on one of my harvester machines? For example, on MACHINE_ONE run rpc command “chia rpc harvester get_plot_directories” so that I get back a list of plot directories from MACHINE_TWO and not MACHINE_ONE? Or would I still need to use Curl to run a remote rpc command against another machine?

Sort of related(maybe), chiaswap does send a remote RPC push_tx call to random node address, at least I think it’s random. Anyway, was enlightening to me that chia could work this way.

Here is the code reference:

It’s not the same type of RPC call as your use case, but might be interesting nonetheless.

Yes, you can!
Simply copy the config from your remote machine to your local machine and point the CHIA_ROOT environment variable to that directory.
It should look like this:

chia-remote  <- your CHIA_ROOT
  |- config
     |- config.yaml
     |- ssl
        |- [...]

Now you only have to change the config entry self_hostname to the hostname/IP of your remote machine, instead of localhost.

1 Like