Skip to content
drnick23 edited this page May 16, 2024 · 4 revisions

Using DrServer

The drserver acts as a gateway between all your drchia harvesters and drsolvers. This is how it fits together in the system:

DrPlotter is the plotting tool that creates Eco3x and Pro4x plots. Given your farmer and pool public keys, it produces "DrPlots" using write-once technology directly to your HDD, typically in 5-7 minutes per plot. No SSD required.

DrChia Harvester, in line with the Chia harvesting protocol, seamlessly integrates with your existing farmer setup. It reads existing chia supported plots and your new DrPlots. DrPlot entries requiring proof solving are sent to the DrServer. Once solved, these proofs are relayed back to the DrChia harvester and then passed onto your Chia farmer.

DrSolver leverages your GPU power to solve proofs for your compressed DrPlot entries.

DrServer is the central hub on your local network that connects all your harvesters and DrSolver's together. It efficiently manages and distributes all the tasks needed across all your harvesters and DrSolvers, to ensure a smooth running system for relaying proofs back to your farmer.

Minimum Requirements

DrServer Minimum Requirements:

  • ~16MB RAM
  • Ubuntu / Debian based system
  • Accessible on local network or remotely

Harvesting DrPlots

1 . Start DrServer

DrServer is the central hub on your network that connects all the drchia harvester and drsolver instances. You only need a single instance of DrServer accessible on your network. Run the following command to start:

drserver

The default port is 8080, and you check it's running by opening a web browser to your local ip and port like so: http://localhost:8080/. If you want to run on a specific port, use:

drserver --port 8080

2. Set your DRSERVER_IP_ADDRESS environment variables

Take note of what local ip address your drserver is running on. For every different machine you have running DrPlotter services, set the environment variable DRSERVER_IP_ADDRESS.

  • Temporary Setting: For a temporary setup in a bash shell, use:

    export DRSERVER_IP_ADDRESS='Your_drserver_ip_address:port'
    

    Replace 'Your_drserver_ip_address:port' with ip address and port of your machine running drserver. Append the port after a semi-colon to the ip address, e.g. 192.168.0.2:8080 for setting the port to 8080.

  • Persistent Setup:

    Edit your .bashrc file for a more persistent solution:

    nano ~/.bashrc
    

    Add the following line to the end of the file (with your actual drserver ip address):

    export DRSERVER_IP_ADDRESS='Your_drserver_ip_address:port'
    

    Save and exit, then apply changes with:

    source ~/.bashrc
    

3. Setup your DrChia harvesters

Important

Make sure you have Chia farmer 2.2.x or later on a separate machine that you can connect to with the drchia harvester.

  • If you're on a new install, first run:

    drchia init
    
  • Then, you need to copy in your ca certificates from your farmer machine, these are usually found at ~/.chia/mainnet/config/ssl/ca. These let the drchia harvester securely talk with your farmer. Initialize these with your harvester:

    drchia init -c /path/to/your/farmers/ca/certificates
    
  • Edit the chia config file on your harvester. In the example below we use nano:

    nano ~/.chia/mainnet/config/config.yaml
    

    Look for farmer_peers: under the harvester: section, and edit the ip to point to your farmer ip. e.g.

    harvester:
      farmer_peer:
        host: <Farmer IP Address>  <--- set to your farmer ip address, e.g. 192.168.1.23
        port: 8447
    

    Don't forget to save your changes.

4. Connect your DrChia Harvester

To verify that your machine knows the ip address of your drserver, you can run:

echo $DRSERVER_IP_ADDRESS

and check that the output matches the ip address of your drserver.

Before you run your harvester, let's change the config so that you can see log outputs to check it's working. Run:

drchia configure --log-level INFO

And now run:

drchia start harvester -r

If all is well, you can now check your logs in ~/.chia/mainnet/log/debug.log

If you see logs similar to this:

2024-01-24T01:05:55.731 harvester drplotter               : INFO     Harvesting 1368 drplots with on disk size 36.82 TiB, after decompression 130.58 eTiB, extra rewards 3.55x

Then congrats, your drchia harvester has found your drplots and is now ready to harvest.

You'll also notice there are some warning logs, if you haven't yet setup a DrSolver to use the GPU to decompress all those proofs. That's what we'll do next.

5. Connect your DrSolvers

A DrSolver can run on the same system as your drchia harvester or the drserver, as long as it has it's own dedicated GPU.

Let's first verify that your machine knows the ip address of your drserver, you can run:

echo $DRSERVER_IP_ADDRESS

and check that the output matches the ip address of your drserver.

If that looks good, then running a drsolver is as simple as:

drsolver

DrSolver will run and connect to the drserver. Once connected, it will display your connected harvesters and solvers that are all synced with the drserver. Below is an example output:

                            DrPlotter Solver v0.10.0

DrPlotter Farm Status
--------------------------------------------------------------------------------
  Status: CONNECTED                                             Uptime: 02:23:30
  DrServer: 192.168.2.44:8080

  Total Harvesters: 2                                           Total Solvers: 1

  Num DrPlots        Raw Size           Effective Size     Extra Rewards
  3911               95.80 TiB          376.20 TiB         +393%


Solver GPU: NVIDIA GeForce RTX 3090
--------------------------------------------------------------------------------
  Fan    Temp   Perf   Pwr:Usage/Cap                                Memory-Usage
  30%    61C    P2     237W / 240W                           23346MiB / 24576MiB

  Status                                            Load  1 min / 5 min / 15 min
  SOLVING                                                    14%  /  34%  /  32%


Commands: [Q]uit

While DrSolver is running, monitor the 5-minute and 15-minute "load" indicators to gauge the current capacity usage of your GPU as a percentage of its total capacity.

6. Verify your DrPlots are Submitting Proofs

To check your DrPlots are submitting proofs, it's recommended to join a pool and adjust the difficulty setting of your pool plots to the lowest possible value, such as 1. This approach is beneficial for several reasons:

  • No Performance Impact: Setting the difficulty to a low level for DrPlots does not affect their performance. Thus, you can monitor their operation without any compromise on efficiency.

  • Effective Monitoring: By using a low difficulty setting, it's easier to track and ensure that you are accruing the expected number of pool points. This setting enhances the visibility of the functioning of your drplots in the pool.

  • Troubleshooting: In case you notice discrepancies in the expected pool points, the low difficulty setting can help in detecting any problems early.

As a result, you can effectively monitor and ensure that your drplots are being farmed correctly and submitting proofs to the pool as anticipated.

Securing your DrServer Remotely

To take advantage of the remote features of DrServer, for instance, so that you can run your DrSolver's also on remote rentable instances, you can secure your server to ensure only your DrChia harvesters and DrSolvers are able to connect using a token system.

First, on your DrServer generate a token:

drserver --generate-token

and you will see output similar to this:

Generated validation token: SLJNCYo0dsEfpl8nRcuV5qDPWD3sYwAoWJMU9ghzpSEafqGG

Then, run your drserver with that token:

drserver --token SLJNCYo0dsEfpl8nRcuV5qDPWD3sYwAoWJMU9ghzpSEafqGG    <-- use your own token here

Alternatively, you can set DRPLOTTER_CLIENT_TOKEN as your environment variable, and drserver will use that if you don't specify the token directly.

When no token is passed in the command line or no DRPLOTTER_CLIENT_TOKEN is set in your environment for DrServer, then anyone can connect to your DrServer without authenticating.

Authenticate your DrSolvers

If your DrServer requires a token, use that same token when starting your DrSolver, like so:

drsolver --drserver-ip mydrserver.com:8080 --token [YOUR TOKEN HERE WITHOUT BRACKETS]

Alternatively, if you don't specify a token you can set DRPLOTTER_CLIENT_TOKEN in your environment variables as well.

Authenticate your DrChia Harvesters

To connect your harvester with your DrServer that requires a token to authenticate, make sure to set the DRPLOTTER_CLIENT_TOKEN and the DRSERVER_IP_ADDRESS in the environment variables.