Pools for the Chia Blockchain [cryptoicons icon=”PPC” color=”#3fa30c”] have begun and released to the mainnet as of a few days ago. As i have been setting up and replotting like everyone else i found that while i am plotting as fast as i can with two computers using MadMax Plotter, my response times are suffering because of the CPU power required to produce a plot using madmax resulting in fewer partials being submitted. Fewer partials submitted is obviously a bad thing because we are not getting 100% of the points we are supposed to get. Today i will fix that using a Raspberry Pi 4 to ensure times are submitted quickly and we get a good stream of points to our pools.
- Needed Items.
- Get Started.
- Install Byobu and Mousepad.
- Set up Swap Space for Ubuntu 20.04.
- Install The Chia Software on the Raspberry Pi Main Node.
- Set up your Plotting and Harvesting Computers.
- Initialise the harvesters with the CA file.
- Set up our Plotting software MadMax.
- Start Plotting.
- Chia Cheat Sheet
- Raspberry Pi 4 – 4GB or 8GB – Running a Chia farmer is quite CPU intensive so you will need one of the 4 or 8gb models
- Any SSD hard drive, the faster the better. We will use this to boot the Raspberry Pi.
- USB to SATA SSD cable. Not all are the same. STARTECH USB 3.1 to SATA. Confirmed Working USB Cable. **Not all work** ❗
- Your plotting computers which will also be your harvesters. We will be using MadMax Plotter as it is easily the fastest plotter. It can be ran in ram only and some plots take only 6 minutes. More on that later. Your plotting computers need to be your fastest computers, gaming computers work great and are normally already capable of fast plotting without much tweaking.
Below is a diagram of the network we will be creating
First and foremost we will need the Chia Blockchain and wallet synced on the Raspberry Pi. We will start with the Raspberry Pi as it takes the most configuration.
We will be running Ubuntu 20.04 Server on our Raspberry Pi and using the CLI to manage our farmer. There are some commands that will allow you to see the status of your network without even using the GUI (version 1.2 has quite a few bugs in the GUI but the CLI seems fine. UPDATE: 1.2.3 fixes a LOT of GUI issues.
CLI = Command Line Interface – GUI = Graphical User Interface
Download and install Ubuntu 20.04 on the Raspberry Pi 4, Other versions can be used but i will be using Ubuntu 20.04 for this tutorial. There are various ways of getting a working bootable 20.04 image but here is a link to the Raspberry Pi forums with a prebuilt image. When you are done ssh into the pi or open a terminal.
Install Byobu and Mousepad.
sudo apt install byobu mousepad
Set up Swap Space for Ubuntu 20.04.
If you wish to use the GUI you will need to modify the swap. If you only need the CLI you can skip this step but sometimes the GUI can come in handy so its a wise choice to have it set up. This applies whether you install the GUI from the chia-blockchain folder or from the .deb file.
sudo dd if=/dev/zero of=/swap bs=1M count=1024 sudo chmod 600 /swap ; sudo mkswap /swap ; sudo swapon /swap
Install The Chia Software on the Raspberry Pi Main Node. 👨🌾
You should always install direct from the GitHub repo. And check all links. Do NOT install .deb files from unknown sources ever. Someone once managed to change the download link for the software on ghithub so make sure you only download from the main website and check all your link urls match. The code below is from the Official Chia-Network Github page.
# Go to root cd # The line below will check for updates then install if there is any # then install git. sudo apt-get update && sudo apt upgrade && sudo apt install git -y # Checkout the source and install the Chia Software git clone https://github.com/Chia-Network/chia-blockchain.git -b latest --recurse-submodules # Change into the chia-blockchain directory cd chia-blockchain # The command below will begin the install sh install.sh # Once finished we activate the Virtual Environment with . ./activate # Start the farmer to get it syncing with the blockchain chia init chia keys generate chia start farmer
There we go. For now leave the Raspberry Pi the Install is complete. Now we need to install the same on all our harvesters/plotters. Assuming your plotters and harvesters are regular PC’s you wont need to do the swap space configuration.
Set up your Plotting and Harvesting Computers.
So we can make sure our plotters are running at full speed we need to run the harvesters directly on the plotting machine.
Plotters/Harvesters DO NOT need to sync to the blockchain.
Open up a terminal on the plotter/harvester machine. Assuming you are also using Ubuntu 20.04 first we will install Chia so we can use it to harvest our new plots. Then we will
# Go to your root directory cd # The line below will check for updates then install if there is any # then install git. sudo apt-get update && sudo apt upgrade && sudo apt install git -y # Checkout the source and install the Chia Software git clone https://github.com/Chia-Network/chia-blockchain.git -b latest --recurse-submodules # Change into the chia-blockchain directory cd chia-blockchain # The command below will begin the install sh install.sh # Once finished we activate the Virtual Environment with . ./activate
Installing our farmer CA files on our Harvester/Plotter.
Adding the certificates from our farmer to our harvesters is extremely important. If you skip this part the harvester will not work at all. Also make sure that sometimes you will need to re init the ca folder after updating the chia software. Always take the ca folder from the main node/farmer. In our case this is the Raspberry Pi.
We need to install our certificate files from our farmer to our harvester so that they will sync. There are various ways of doing this but i am simply going to use a USB stick to make a copy of the ca folder from the Raspberry Pi
If you cannot see the .chia folder press
CTRL+H to show hidden files and folders.
The folder you need is located on the Raspberry Pi at the location:
Copy the folder to your USB stick. If you have to update the main node you may need to copy the certificates again. If you are getting invalid partials then you may need to re-init the ca files.
Initialize the harvesters with the CA file.
We are nearly completed, all we need to do now is init the ca folder on our harvesters. Type the following command on your harvester.
# init the ca folder on our USB stick chia init -c /media/location-of-ca-folder-on-usb-stick/ # example chia init -c /home/dazeb/ca
The output should be as follows:
Deleting your OLD CA in /home/dazeb/.chia/mainnet/config/ssl/ca Copying your CA from /home/dazeb/ca to /home/dazeb/.chia/mainnet/config/ssl/ca /home/dazeb/.chia/mainnet/config/ssl/ca/private_ca.cr /home/dazeb/.chia/mainnet/config/ssl/ca/chia_ca.crt /home/dazeb/.chia/mainnet/config/ssl/ca/private_ca.key /home/dazeb/.chia/mainnet/config/ssl/ca/chia_ca.key Found private CA in /home/dazeb/.chia/mainnet, using it to generate TLS certificates
And now our harvester is using the keys from our main node/farmer. We may need to generate some default keys on our harvester machines. You can do that by typing
chia keys generate
We don’t want our main wallet key to be used on our harvesters, just generate a new one instead. It is advisable to only have your keys for your wallet on the main node .
The last command we need to do is to set our harvester IP address and port. You can do this from the CLI or by editing the config.yaml file.
- Use CLI and type the command below
# Set the IP and port of the main farmer node. chia configure --set-farmer-peer IPADDRESS:PORT
- Edit the file at
Find the following block of text starting at
harvester: and edit the harvester peer
harvester: chia_ssl_ca: crt: config/ssl/ca/chia_ca.crt key: config/ssl/ca/chia_ca.key farmer_peer: host: localhost <--- CHANGE THIS TO MAIN NODE IP port: 8447
Save the file then close it and restart the harvester with:
chia start harvester -r
At this point we can try to see if our harvester is connecting with our farmer. On our Raspberry Pi open the terminal window from earlier and type:-
chia farm summary
The output should be similar to below
Farming status: Synced Total chia farmed: 0.0 User transaction fees: 0.0 Block rewards: 0.0 Last height farmed: 0 Local Harvester 0 plots of size: 0.000 MiB Remote Harvester for IP: 192.168.0.19 147 plots of size: 14.549 TiB Remote Harvester for IP: 192.168.0.100 99 plots of size: 9.798 TiB Plot count for all harvesters: 246 Total size of plots: 24.348 TiB Estimated network space: 31.776 EiB Expected time to win: 9 months and 2 weeks Note: log into your key using 'chia wallet show' to see rewards for each key
Set up our Plotting software MadMax. 🍃
We now have our main node and farmer set up and also a harvester. Let’s install MadMax so we can start plotting on our harvesters.
MadMax’s plotting software is by far the best plotting software out there and is certainly the quickest at creating plots and at the time of writing i believe the quickest plot time is 6 minutes.
Go the github repo if you need to verify it, all the commands below will be exactly the same but with some explanation for each command.
Open a new terminal window separate from your chia terminal
# Install some dependencies sudo apt install -y libsodium-dev cmake g++ git build-essential # Clone the repo git clone https://github.com/madMAx43v3r/chia-plotter.git # Change to the downloaded directory cd chia-plotter # Update application submodules git submodule update --init # Make the binaries ./make_devel.sh # Example command - shows help and options ./build/chia_plot --help
And we are done installing MadMax.
Now depending on your hardware will depend on what commands to use but an example is below
# Change directory to the MadMax binaries cd chia-plotter/build # Start the plotting processes ./chia_plot -n -1 -w -c xch1j40ekpdgzxvtzqaygaf07jzrpaiihqeye6sruc0erxzzq6q8e72q8rl0lh -f a370be1accda3962ad333be3dd674d3ffe03685d7f0162fe4d8b880a28d3dd6fb4e9073779a81ed26ad86864cf443b39 -t /mnt/1tbSSD/chia-temp/ -d /mnt/12tb/chia-pools-folder/ # Here we are using the following options -n -1 = Do unlimited amount of plots -w = Wait until copy has finished before starting a new plot -c = Contract Address for pools -f = Farmer key -t = Temp SSD for plotting -d = Destination HDD # Do chia_plot --help to show options
At this point we are fully set up and producing plots. The Chia main node (farmer) picks up on the new plots when they are created. When one drive is full change the location to the new drive and start again.
There is a few common problems people have when using this setup and it mostly indicates problems with the ca file. Make sure to use the ca folder from the main raspberry pi farmer node and you should be ok.
Set upnp to false to get more connections. Some upnp software has a connection limit. you are best just disabling upnp and forwarding the port. The command below will disable upnp on the Raspberry Pi
chia configure --upnp false
You can also enable upnp
chia configure --enable-upnp
Set your log level via the command line. This can be handy in debugging your setup.
chia configure --set-log-level INFO
Chia Commands Cheatsheet
Basic commands list
chia init – migrates files from an old version to the latest version after an update
chia start node – starts node only
chia start node -r – restarts the node
chia start farmer – starts the farmer, harvester, bode, and wallet
chia start farmer -r – restarts everything
chia plots check – checks plot files
chia show -s – show status of node
chia farm summary – Show summary of the farmer
chia wallet show – Show wallet data
chia keys generate – Generate keys
chia keys add – Add keys / seed
chia stop -d all – turn off all Chia services
chia netspace – show the current size of the network
chia version – shows the current chia version
chia wallet get_address – Get a receiving address
chia wallet get_transaction – Obtain a transaction
chia wallet get_transactions – Show all transactions
chia wallet show – Show wallet data
chia wallet send – send chia to another wallet
chia plots add -d PATH – adds a directory as plot directory
chia plots check – checks the existing plot files
chia plots create – creates a new plot (see above)
chia plots remove – removes a plot directory from the configuration
chia plots show – shows the currently stored paths for plots
chia farm challenges – displays recent challenges
chia farm summary – displays a summary of the farmer
chia keys add – add a key by seed
chia keys delete -f NUMBER – deletes the key with the fingerprint NUMBER
chia keys delete_all – deletes all keys
chia keys generate – generates a new key
chia keys generate_and_print – generates a new key WITHOUT saving it
chia keys show – shows all saved keys
chia keys sign – signs a message with the private key
chia keys verify – verifies a signature
Thanks to LautenBacher for the cheatsheet.
Hello there! My name is Darren and i am a hobbyist/homelab/crypto enthusiast. If you liked this post please consider signing up for a Digital Ocean account using my link and you will receive $100 in free credit while at the same time helping me to cover the costs of my servers. Thank you!
XCH: xch1hrumdza9u6slw5hz343p3yh954wvjs4rqnqdkq6huanctf0vytzqqkahxk BTC: 1BVwmPMt6kxRe88EKhThJviFp3M4MhubTA ETH: 0xa958d40518d76168BB795947Bf96AafD6bccc177 LTC: MBJdCsnZXDuXBYme6Ur7VFAeYw4LTFM9CP BAT: 0xab574A09fFf2aa391658D3D048265ad1401cA7AF DOGE: DBCchyovcTXSioWM392kKydJxY5nyECYFB