Skip to content

Workers

Guy Davis edited this page Jul 28, 2021 · 59 revisions

Start a Discussion or join our Discord for support and to help out.

While the default installation of Machinaris is standalone, management of multiple Machinaris workers on your local-area network (LAN) is also supported. Machinaris offers a single WebUI to control all the workers (plotters, harvesters, farmers) on your LAN. Here's an example network layout:

Workers

NOTE: This is NOT intended for management of multiple instances at different geographic sites over a wide area network (WAN). Please investigate usage of VPN tunneling and/or secured web-proxy in that case. DO NOT simply port-forward ports 8447, 6885 (Flax), 8926 or 8927 at your router. Ports 8447, 6885, 8926 and 8927 should NOT be available to the public Internet!

Launching

First, you'll need a Machinaris controller running (fullnode or farmer). Then you can launch workers in a mode from 'harvester', 'farmer', 'plotter', 'harvester+plotter', and 'farmer+plotter'.

Controller

As with standalone, one full-node instance of Machinaris should be running as controller for your network. Use the Launch Wizard to create a Docker Run or Docker Compose command for your system.

Plotter

There may be multiple plotters running on the LAN. Visit the Workers page of your Machinaris controller (above), and click the New button to generate a Docker Run or Compose for your system.

Harvester

There may be multiple harvesters running on the LAN. Visit the Workers page of your Machinaris controller (above), and click the New button to generate a Docker Run or Compose for your system. Before running the container, create the .machinaris directory and place a export of your farmer's CA in .machinaris/farmer_ca which should then contain:

  • chia_ca.crt
  • chia_ca.key
  • private_ca.crt
  • private_ca.key

Note, if also harvesting Flax, be sure to copy the ca folder (example on Unraid is /mnt/user/appdata/machinaris/flax/mainnet/config/ssl/ca) over to to ~/.machinaris/flax/farmer_ca. This will import the Flax certificates as well.

Harvester+Plotter

It's also possible to combine both harvesting and plotting duties in a single Machinaris container launch. Visit the Workers page of your Machinaris controller (above), and click the New button to generate a Docker Run or Compose for your system. You can check both the 'Harvester' and 'Plotter' mode buttons at the same time. Don't forget to copy your fullnode's ca certificates over as outlined above in the harvester section.

Monitoring

When running, browsing to Machinaris on your Controller instance will show status for all connected workers:

Status

The communication between controller and worker is bi-directional via REST API on port 8927. Please ensure you have opened the required ports (8926 & 8927) in the firewalls on each computer running Machinaris. In example above, the worker (gimli) is sending its status to the controller (aragorn), but due to firewall on the worker, the controller shows it as Unreachable.

Control

With multiple Machinaris plotters on your LAN, you can configure and control them from the Plotting page on your Controller instance:

Plotting

FAQ

My network has no local DNS, can I use IPs to connect workers?

While Workers design was primarily for a home LAN with a shared local DNS resolving all local machine hostnames, it is possible to override this behavior when launching Machainaris. If you pass -e worker_address=IP_ADDRESS where IP_ADDRESS is a routable address within your LAN (or VLAN if using VPN), then a common DNS shouldn't be needed as Machinaris systems will reach that worker by the IP, not an un-routable hostname.

For example, on Linux, to launch a harvester+plotter at 192.168.1.120 connecting to the controller at 192.168.1.103:

docker run -d --name=machinaris -e mode=harvester+plotter -d -t -h $(hostname -s) -e controller_host=192.168.1.103 -e worker_address=192.168.1.120 -p 8926:8926 -p 8927:8927 -e TZ="America/Edmonton" -e farmer_address=FARMER_HOST -e farmer_pk=YOUR_FARMER_PK -e pool_pk=YOUR_POOL_PK -v ~/.machinaris:/root/.chia:rw -v /path/to/temp:/plotting:rw -v /path/to/plots:/plots:rw ghcr.io/guydavis/machinaris

API requests sent between the controller and worker should then all use these IP addresses, bypassing the need for a DNS lookup. Don't forget to copy your farmer_ca SSL certs into place before launching though!

What communication happens between controller and workers?

All controllers and workers are running a REST-API server on port tcp/8927. In general, workers submit their own status (farm/plotting/plots/etc) to their controller's API endpoint. As well, the controller can send commands to a worker at their API endpoint, to start/stop plotting, view logs, etc. Currently, there is no authentication of these endpoints as it is intended for ease-of-use on a home LAN. As such, you mustn't expose these ports outside your LAN or VLAN, particularly not to the public Internet.

Clone this wiki locally