A starting place for chia git installation and plotting on several Mac mini M1 8GB RAM 512GB SSD machines. One of the goals was to avoid homebrew and easy management through SSH. This includes all the scripts used to manage several Mac mini machines. Note, phase 1 isn't inteded to be optimal. It was meant to get started. Phase 3 is much more optimal/fast but will likely cost more.
- DONE - Phase 1 (Beginner's Guide) - a quick start and explanation of how to get setup plotting/farming Chia today.
- Goal: 50 TB and 24 plots/day.
- Note: I do recommend buying the Mac mini M1 16GB ( even if it's only 1 or 2 ) this will double the plotting speed (covered in Phase 3)
- IN PROGERSS - Phase 2 (Increase Storage) - Share Phase 2 to grow your storage for long haul.
- Goal: 100 TB+ with SAS storage
- COMING SOON - Phase 3 (Increase Plotting Speed) - Share Phase 3 to increase the plotting speed to 36 plots/day.
- Goal: 36+ plots/day ( 16-18 plots/day/mini )
- Equipment for each Mac mini M1 16GB RAM:
- 2x Thunderbolt 3 enclosure for NVMe M.2 SSD
- 2x NVMe M.2 SSD
- 2x USB-C enclosure for NVMe M.2 SSD ( or at least SSD )
- 2x NVMe M.2 SSD
This project took a lot of time and effort to create and to share with you. Consider sponsoring or supporting this project. This is not necessary but more a kind gesture.
- XCH Address: xch1w3c2nkkfh990qwvejlkj94f75cfy5fk2ecj3v2c7ja0xfxrzmgwst32tle
- ETH Address: 0x7f9F5Fd62E97B8Ed490B464CF710B45054720b92
- BTC Address: bc1q6k6tgj2nmyu44fwvut8hfh0dzht53a2nzaajve
- 4x Mac mini M1 8GB RAM 512GB SSD
- 4x Samsung (MZ-V8V1T0B/AM) 980 SSD 1TB NVMe
- 4x Sabrent USB 3.2 Type-C NVMe enclosure
- 1x Sabrent 5-bay dock/enclosure ( USB-C )
- 4x 12TB WD NAS drives
- 1x 750GB HGST NAS drive
- Mac mini M1
- 2x Thunderbolt 4 ( 40 Gbps )
- 2x USB-C 3.2 ( 10 Gbps )
- 1x LAN port ( either 1 Gpbs or 10 Gbps )
- LAN - A 1 Gbps network is pretty slow for this type of setup. This limits transfers pretty heavilty from each Mac mini to the storage.
- USB-C - Even if you have the 10 Gbps USB 3.2 that's still not as fast as what the Mac is capable of writing.
- I highly recommend looking into a Thunderbolt 3 or better NVMe enclosures ( OWC makes one that's reasonable price )
- Purchase hardware and assemble.
- For this guide the macOS usernames for each plotting machine are:
adminofthemac1
,adminofthemac2
,adminofthemac3
,adminofthemac4
- System Prefs > Engery Saver > prevent computer from sleeping
- Sleeping prevents the plotter and farmer from working.
- System Prefs > Engery Saver > start up after power failure
- System Prefs > Sharing > Remote Login
- System Prefs > Sharing > Remote Management
- System Prefs > Sharing > File Sharing
Note: steps that require the macOS Keychain Access need to be done from the macOS UI (in Terminal) not SSH.
- Install Xcode dev tools:
xcode-select —install
- Alternatively, download the
Command_Line_Tools_for_Xcode_12.5.dmg
yourself once and send to each mac and then install.
- Install python
curl https://pyenv.run | bash
export pyenv export PATH="/Users/adminofthemac1/.pyenv/bin:$PATH" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)"
exec $SHELL
pyenv update
pyenv install 3.9.4
pyenv global 3.9.4
- Setup Rust + Cargo (package manager) - only if you are not using Homebrew ( this is a requirement in chia 1.1.5+ )
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
exec $SHELL
rustup --version
- Setup Chia from git
pushd ~/Documents/
git clone https://github.com/Chia-Network/chia-blockchain.git -b latest
cd chia-blockchain
sh install.sh
. ./activate
chia init
- Enable Keychain Access - must be done in macOS UI (in Terminal) for Keychain Access UI password prompt
- Repeat above steps on the machine EXCEPT
sh install.sh
chia keys add
- Enter the mnemonic ( assumes you created one in a Chia GUI already )
- Repeat above steps on the machine EXCEPT
- Start a farmer+node on one machine
chia start all
- Add your harddrives to the farmer
chia plots add -d /Volumes/chiaplot-ext-1
chia plots add -d /Volumes/chiaplot-ext-2
chia plots add -d /Volumes/chiaplot-ext-3
chia plots add -d /Volumes/chiaplot-ext-4
chia plots add -d /Volumes/chiaplot-ext-5
- Done
Note for some reason I can't get plotting to run (macOS Keychain Access errors) from SSH. The plot start must be done from macOS UI in Terminal.
- Add our own chia log dir for performance scripts to use
mkdir -p ~/.chia/logs
- Plot a single plot to verify everything is working:
screen -d -m -S chia1 bash -c 'pushd ~/Documents/chia-blockchain/ && . ./activate && sleep 0 && chia plots create -k32 -n1 -t/Volumes/chia-temp -2-t/Volumes/chia-temp -d/Volumes/chiaplot-ext-1 -b7000 -u128 -r6 -a########## | tee ~/.chia/logs/chia1_1_.log'
- This assumes your are writing to your mounted external drive
- Uses 7GB of RAM ( leave 1GB for macOS to avoid swapping to the hard drive )
- Uses 6 cores/threads ( M1 chip has 8 cores - 4 performance cores and 4 low energy cores ). AFAIK: Chia will mostly use 1 core and sometimes the others.
- Wait about 4 hours. See below for scripts to check on progress.
Once you got a plot on each machine it'll be time to optimize and test various settings. That part is left up to you. Here's a setting that gets 6-8 plots/day if no farmer/node is running on the machine:
- Concurrent plotting 6-8 plots/day using 3400MB RAM and 4 cores/threads each (will plot 40 plots). You can repeat these settings on each workstation and replacing the final destination drive from
chiaplot-ext-1
to whatever you have it named/mounted:screen -d -m -S chia1 bash -c 'pushd ~/Documents/chia-blockchain/ && . ./activate && sleep 0 && chia plots create -k32 -n40 -t/Volumes/chia-temp -2-t/Volumes/chia-temp -d/Volumes/chiaplot-ext-1 -b3400 -u128 -r4 -a########## | tee ~/.chia/logs/chia1_1_.log'
screen -d -m -S chia2 bash -c 'pushd ~/Documents/chia-blockchain/ && . ./activate && sleep 3600 && chia plots create -k32 -n40 -t/Volumes/chia-temp -2-t/Volumes/chia-temp -d/Volumes/chiaplot-ext-1 -b3400 -u128 -r4 -a########## | tee ~/.chia/logs/chia2_1_.log'
- Check progress for each plotter (press
CTRL+a
thend
to exitscreen
):screen -x chia1
screen -x chia2
- How do I see how far along are the plots in percentages % ?
- Download this and place in
~/Documents/
on your plotters: chia-plot-progress.sh date; ~/Documents/chia-plot-progress.sh ~/.chia/logs/*
- Download this and place in
- How long are my plots taking?
- Total time:
cat ~/.chia/logs/chia1_1_.log | grep "Total time"; echo --------------------------------------------------; cat ~/.chia/logs/chia2_1_.log | grep "Total time";
- Copy time:
cat ~/.chia/logs/chia1_1_.log | grep "Copy time"; echo --------------------------------------------------; cat ~/.chia/logs/chia2_1_.log | grep "Copy time";
- Averages of plotting:
grep -i "total time" ~/.chia/logs/*.log |awk '{sum=sum+$4} {avg=sum/NR} {tday=86400/avg*8*101.366/1024} END {printf "%d K32 plots, avg %0.1f seconds, %0.2f TiB/day \n", NR, avg, tday}'
- Average of copying:
grep -i "Copy time" ~/.chia/logs/*.log |awk '{sum=sum+$4} {avg=sum/NR} {tday=86400/avg*8*101.366/1024} END {printf "%d K32 plots, avg %0.1f seconds, %0.2f TiB/day \n", NR, avg, tday}'
- Total time:
- I got disconnected from SSH, copy/paste isn't working, what do I do?
reset
ssh [email protected]
pushd ~/Documents/chia-blockchain/; . ./activate;
chia farm summary
- Is the plotter working correctly?
tail ~/.chia/logs/chia1_1_.log ~/.chia/logs/chia2_1_.log
- Are there any errors / warnings that I should pay attention to?
- `grep ~/.chia/mainnet/log/debug.log -e harvester
- I have an extra SSD plugged into a Mac to store final plots. How can I move all the files from SSD to the mounted drive with SSH?
- `SCREEN -d -m -S transporter bash -c 'rsync -aP --remove-source-files /Volumes/SAMSUNG_T5/ /Volumes/chiaplot-ext-1/'
screen -ls
screen -x transporter
(pressCTRL+a
thend
to exitscreen
)