Chia cryptocurrency’s growing popularity has attracted the attention of many developers, who are investing more and more effort into improving the software, while also developing various software solutions.
One of these solutions is “madMAx43v3r“, which has extensive experience in the development of various mining software (in particular on GPU). Unfortunately, the official documentation lacks information on how to build “chia-plotter” on macOS. Our team worked to solve this issue and succesfully closed that gap, and now we are able to provide you a series of steps you will need to follow on macOS, in order to build “chia-plotter” from the source code.
We have already builded version for MacOS in our Telegram and Discord. If you don’t want to bother you can just download it.
In fact, the speed of plotting depends on many parameters: what disks you use (SATA/NVMExpress HDD/SSD, USB 2.0/3.1 HDD/SSD, USB-C HDD/SSD or Thunderbolt 3 NVMExpress, etc), what year you have a Mac (for example Intel i5 based Mac mini mid 2011 or Intel i9 based MacBook Pro 16″ 2019) and how many threads it has (4..16), how much RAM (4..128 GB), etc.
- Intel or M1 based Mac;
- macOS Catalina (10.15.x) or macOS Big Sur (11.x);
- Xcode 12.x.
- On unsupported Macs, you can use the “dosdude1’s” patcher to install Catalina (for example on Mac mini mid 2011)
- Please note that about 1 GB of RAM will be used per thread (with 128 buckets). Thus, with default settings (4 threads and 128 buckets) about 4 GB of RAM will be used. Reducing the number of buckets leads to an increase in the used RAM – with 64 buckets 2 GB of memory will be used per thread (for example with 4 threads and 64 buckets, 8 GB of RAM will be used). Increasing the number of buckets lead to a decrease in the used RAM – with 256 buckets 0.5 GB of RAM will be used per thread (for example with 4 threads and 256 buckets, 2 GB of RAM will be used).
- Please note that the operating system also requires RAM. If there is no free RAM left, the hard disk (or system SSD) will be used (the swap file will be used) which will lead to a significant drop in speed. You can also use utilities to free up RAM on your Mac (for example SmartMemoryCleaner).
Before you start run next Terminal commands:
After that just apply all of the following commands in the Terminal application:
This will install Xcode Command Line Tool:
brew install libsodium cmake git autoconf automake libtool wget
brew uninstall gmp
brew link cmake
If you downloaded Xcode run these:
sudo ln -s /usr/local/include/sodium.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
sudo ln -s /usr/local/include/sodium /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
If you downloaded Xcode Command Line Tool:
sudo ln -s /usr/local/include/sodium.h /Library/Developer/CommandLineTools/usr/include
sudo ln -s /usr/local/include/sodium /Library/Developer/CommandLineTools/usr/include
Confirm which directory you have on YOUR Mac before applying following commands!
For Intel based Macs:
wget https://raw.githubusercontent.com/facebookincubator/fizz/master/build/fbcode_builder/CMake/FindSodium.cmake -O /usr/local/opt/cmake/share/cmake/Modules/FindSodium.cmake
For M1 based Macs:
Please note that instead of the “*” you need to specify the CMake version that is installed on your Mac, for example “3.20.5”.
Place number you get instead of * below:
wget https://raw.githubusercontent.com/facebookincubator/fizz/master/build/fbcode_builder/CMake/FindSodium.cmake -O /opt/homebrew/Cellar/cmake/*/share/cmake/Modules/FindSodium.cmake
Now we can build chia-plotter:
git clone https://github.com/madMAx43v3r/chia-plotter.git
git submodule update --init
Now all you need to do is to wait for the app to build successfully…
Lastly run the command below, in the Terminal application in order to familiarize yourself with all the possible parameters that can be set:
If a maximum open file limit error occurs (as default OS setting is 256, which is too low for default bucket size of
256), run this before starting the plotter (this file limit change will only affect the current session):
ulimit -n 3000
What should I do if I get errors
If at any of the steps you get an error, you can delete the build folder from the chia-plotter folder manually or in the Terminal application:
rm -rf build
Or use the clean_all.sh script:
After that, try to build chia-plotter again starting with the command ./make_devel.sh command in this tutorial.
If trying to build chia-plotter again fails, you can delete the entire chia-plotter folder and start over from the first steps in this tutorial.
How to create PlotNFT Plots with MadMax
In order to create a PlotNFT Plot you need to get the farmer’s key and the address of the PlotNFT. If you haven’t created a PlotNFT yet, you can find out how to create one in this article How to connect to (Chia) XCH Cloud Pool
After PlotNFT is created, you can run the following command in the Terminal application and copy P2 singleton address (pool contract address for plotting):
/Applications/Chia.app/Contents/Resources/app.asar.unpacked/daemon/chia plotnft show
After that, you can run the following command in the Terminal application and copy Farmer public key:
/Applications/Chia.app/Contents/Resources/app.asar.unpacked/daemon/chia keys show
Now you can run chia-plotter with the parameters you want to create the PlotNFT plot.
As an example, we create 1 plot using 4 processor threads and 256 buckets (default).
In this case, the first disk we have is the Disk1 (disk name in Finder) disk on which the Plots folder is created – needs about 220 GiB space, it will handle about 25% of all writes.
The second drive we have is the Disk2 drive on which the Plots folder is created – needs about 110 GiB space and ideally is a RAM drive, it will handle about 75% of all writes.
The drive to which the plot will be saved is the Disk3 drive on which the Plots folder is created.
Please note that instead of xch10000000000 you must insert your P2 singleton address (pool contract address for plotting), and instead of 1234567890 you must insert your Farmer public key.
./build/chia_plot -n 1 -r 4 -u 256 -t /Volumes/Disk1/Plots/ -2 /Volumes/Disk2/Plots/ -d /Volumes/Disk3/Chia/ -c xch10000000000 -f 1234567890
Parameters for plotting command
Here’s a list of all parameters for plotting command. You can also type –help to view it in terminal.
|-n, –count arg||Number of plots to create (default = 1, -1 = infinite)|
|-r, –threads arg|
|-u, –buckets arg||Number of buckets (default = 256)|
|-v, –buckets3 arg||Number of buckets for phase 3+4 (default = buckets)|
|-t, –tmpdir arg||Temporary directory, needs ~220 GiB (default = $PWD)|
|-2, –tmpdir2 arg||Temporary directory 2, needs ~110 GiB [RAM] (default = <tmpdir>)|
|-d, –finaldir arg||Final directory (default = <tmpdir>)|
|-w, –waitforcopy||Wait for copy to start next plot|
|-p, –poolkey arg||Pool Public Key (48 bytes)|
|-c, –contract arg||Pool Contract Address (62 chars)|
|-f, –farmerkey arg||Farmer Public Key (48 bytes)|
|-G, –tmptoggle||Alternate tmpdir/tmpdir2 (default = false)|
The developer has provided a key information about the portability of the build on other Macs that you might use for plotting “The binaries will end up in build /, you can copy them elsewhere freely (on the same machine, or similar OS).“
You can find more informations on the project’s page GitHub.