- Chia plotting basics
- Introduction
- Getting going
- Good assumptions
- Mastering plotting
- Learning more
- Thanks
- Updates
- Как установить Chia на Ubuntu
- Установка Chia в Ubuntu
- 1. Загрузка deb пакета
- 2. Установка пакета
- 3. Русификация
- 4. Создание кошелька
- 5. Использование кошелька
- Установка Chia без графического интерфейса
- Выводы
Chia plotting basics
— February 22, 2021
Introduction
First it is important to know that there are two very different parts of being a Chia farmer. There is creating the plots or plotting and then there is farming the plots. In this post we are going to focus on the process of creating your plots. The types of machines and storage space are very different than the types of hardware you ultimately want to use to farm. You can see some example farming rigs on our very useful repository wiki.
We initially recommend that you try plotting with what you have around. The only caution about that is that you want to limit the amount of plots you create that use your internal/consumer grade SSD as the temporary space. SSDs have very different wear lives and we have detailed information on SSD endurance.
You really never need to plot a plot with a k size larger than 32. Those who do plot larger are either doing them to show off (and we encourage this for fun) or to optimally fill the open space on a specific drive. A k32 will take up 101.3 GiB of space once completed but will need a total of 239 GiB of temporary space as it is being created. A single k32 plotting process never needs more than 239 GiB of space. One needs to be careful here as 239 gibibytes uses 1024 as its divisor where GB or gigabytes uses 1000 as the divisor. That means you will need 256.6 GB of temporary space and the final plot file will take 108.8 GB. A k32 plot can be done by one expert we know in just under 4 hours, but most experts are creating plots in 5 hours and most folks average around 9-12 hours.
Creating a plot is a process that will take RAM, CPU cycles, IO to your disks and it will use them differently in each of the four phases of plotting. Everyone wants a magic “right” answer or to use AI to figure out the optimal plotting strategy for their machine. However almost every machine is different along one of these parameters so you just have to try. Longer term we will be able query your machine and make some recommendations but that is not today. You really will have to test. And no, the experts in the various Keybase channels don’t know your best settings either.
Getting going
The first phase generates all of your proofs of space by creating seven tables of cryptographic hashes and saving them to your temporary directory. Phase 2 back-propagates through the hashes, phase 3 sorts and algorithmically compress these hashes in the temporary directory while starting to build the final file and phase 4 completes the file and moves it into your final plot destination.
One of the major bottlenecks is usually the total sustained write speed of the disk underneath your temporary directory. We recommend used datacenter SSD if you really want to go fast and not sacrifice consumer SSDs making plots. NVMe is faster than SAS and SAS is faster than SATA. This PC World overview of storage technologies can explain these acronyms and the differences. TBW, or terabytes written, is generally how SSD drive life is measured. One k32 writes 1.8TiB in non-bitfield mode and 1.6 TiB with bitfield enabled. More on bitfield in a moment.
Making the single fastest plot isn’t generally the best plotting strategy however. Often you’re getting amazing speed because you’re using the turbo core of that multi core processor. The folks who plot the most have shown that you should measure in TB (TiB if you’re old school like us) per day. The way to get the maximum TB/day is to plot lots of plots in parallel. Some of the top plotters use datacenter SSDs. Some use SAS drives. Raid 0 is often very handy to tie together a couple of small fast drives into one say 2TB partition so you could fit 5 k32 temporary spaces on that one virtual RAID drive.
All of that said, for my personal plotting I use a 2017 iMac and a 12TB Western Digital external drive on USB 3.0 for both temporary and final directory, and I get a k32 about every 10 hours.
Good assumptions
There are some good rules of thumb for now. These can change as we will be returning to making some plotting speed improvements after launch. First we need to explain bitfield versus no bitfield plotting. Originally, the plotter did not use bitfield back sorting. The bitfield back sort is theoretically faster than not using the bitfield and we already know that it saves 12% of total writes but requires more RAM. We have a hunch we can speed bitfield up 10% and make it work on more processors but that’s not in there yet. What we do know is that, as long as you’re ok with the 12% more total writes, no bitfield will work faster when SSD or fast SAS is your temporary directory. If your temporary directory is on a regular HDD, like mine is, bitfield is 20% faster than no bitfield. Older CPUs may not see the speed increase as much as noted above.
Returning to the rules, here are a few. Never touch the stripe size of 65536. No one has found a speed up over that value and we are likely removing it from the options list. (Update: as of 3/11/21 stripe size has been removed as an option.) You almost never want to use any bucket values other than 128. Less buckets requires more RAM for each plotting process. 64 buckets requires twice the RAM.
As far as number of threads are concerned you are generally going to want 2 to 4. More than 4 seems to have diminishing returns and 2 threads is a lot better than 1. More threads also require a bit more memory to successfully complete a plot. The threading is only used in phase 1 currently.
As of Chia 1.0.4, RAM requirements are almost identical between bitfield and no bitfield. This is a chart of the various RAM choices assuming a k32 with 128 buckets and 2 to 4 threads:
RAM MiB: | Minimum | Medium | Maximum |
---|---|---|---|
Bitfield | 900 | 2640 | 3400 |
No Bitfield | 900 | 2640 | 3400 |
Below minimum your plot will fail. Medium is enough RAM that you’ll get most speed improvements, but not all. This is useful when you’re trying to get more plotting processes parallel and have limited RAM. Using anything over the maximum is wasting RAM as you will not plot any faster. We are pretty certain of the minimums and maximums but there is community debate about the medium values. We’ll update this chart accordingly as we have better data.
Mastering plotting
Most people start plotting from the GUI. You can successfully complete a couple of plots in parallel from there to get the hang of things. As people choose to get more serious they migrate to the command line. It is worth noting that Windows suffers 5-10% slower plot times versus MacOS or Linux for now.
Once you get some experience you will probably want to know how to create more and more plots in parallel. Luckily we have a replay on YouTube of our cocktails with plotting experts. They had much to share about their various approaches. Some used servers and datacenter SSD, some bought used servers and SAS drives for temporary directories, some expand their consumer/gaming machines, and some focused on lots of smaller used machines. Many of them have compiled a spreadsheet of reference plotting hardware with plot speeds to help get you thinking about any hardware you might want to change or acquire and see how your plotting results measure up.
As you start parallel plotting you need to be careful to not over allocate memory when you are plotting. If you cause your operating system to swap, you are not going to be happy with your outcome. You don’t have to be as careful with thread count.
It is also a very common plotting strategy to plot on say your gaming machine and then move your plots to a Raspberry Pi 4 with a lot of USB ports. All you need is your same 24 word mnemonic on both machines. Alternatively you can just run a remote harvester on your Pi and have it connect to your gaming machine where you are running node and farmer and only have your private keys on one machine.
Learning more
Everyone trying to create plots should read through our repository FAQ. It really does answer 90% of the questions you might have about plotting (and farming.)
Once you have read the FAQ, you’ll find a supportive community in these channels on our public Keybase channels.
Keybase Channel | Topic |
---|---|
#beginner | For those questions you are afraid to ask |
#testnet | For all things testnet — an intermediate skill level |
#plotting-hardware | The expert plotters are here. Hardware, software and plotting strategy |
Thanks
@pyl, @kiwihaitch, @psydafke, and @storage_jm all helped out on this post. The mistakes are mine. Should something need to be updated I will edit and post the errata down here.
Updates
As of Chia version 1.0.4, RAM min/med/max values have been updated.
Источник
Как установить Chia на Ubuntu
Chia — это криптовалюта, стремительно набирающая популярность в последнее время. В отличие от уже всем известных Ethereum и Bitcoin, для майнинга этой криптовалюты нужны жесткие диски. Это не первая криптовалюта, которая пытается быть более экологичной и потреблять меньше энергии для майнинга, но первая, что завоевала такую популярность. За последние недели сеть очень сильно увеличилась поэтому майнить её в соло уже не выгодно.
Но вы всё же можете захотеть поставить кошелек Chia в свою систему для того чтобы узнать как это работает или чтобы вывести деньги с пулов или кранов. В этой статье мы рассмотрим как выполняется установка Chia Ubuntu 20.04, а также поговорим о том как работать с программой в командной строке.
Установка Chia в Ubuntu
1. Загрузка deb пакета
Разработчики Chia подготовили установщики не только для Windows, но и для Linux в виде deb и rpm пакетов. Даже больше, кроме архитектуры x86 поддерживается архитектура arm64. Откройте официальную страницу релизов проекта на Github и найдите там нужный файл. Для Ubuntu необходимо скачать deb пакет для архитектуры amd64:
2. Установка пакета
Полученный пакет можно установить с помощью центра приложений, выполнив на нём двойной клик в файловом менеджере или с помощью утилиты dpkg:
После этого программа будет установлена и её можно запустить из главного меню:
3. Русификация
Если вы хотите чтобы программа была на русском языке, кликните по кнопке со списком языков в верхнем правом углу экрана и выберите Русский:
4. Создание кошелька
Для создания кошелька нажмите кнопку Создать новый приватный ключ.
Сразу же после этого вам будет предложена мнемоническая фраза из 24 слов, которую надо куда-то записать для того чтобы потом иметь возможность восстановить кошелёк:
После того, как вы нажмете кнопку Далее, перед вами откроется окно программы и начнётся синхронизация с сетью:
Для того чтобы полноценно работать с кошельком и иметь возможность участвовать в фарминге, нужно чтобы синхронизация полностью завершилась.
5. Использование кошелька
Кошелёк можно найти на вкладке Кошельки. Здесь отображается ваш баланс и есть возможность отправить Chia на другой кошелёк. А немного ниже вы можете узнать свой адрес кошелька Chia для того чтобы перевести на него деньги:
Про создание участков и фарминг здесь рассказывать подробно не буду. Это довольно обширная тема и всё описано в этой статье. Установка chia Ubuntu завершена. Для обновления chia, установленной таким способом необходимо просто переустановить новую версию пакета.
Установка Chia без графического интерфейса
Если у вас сервер и вы хотите работать с Chia только в командной строке, например, плотить Chia, то описанный выше способ установки вам не подойдёт. Пакет deb собранный только для графического интерфейса и нужных инструментов не содержит. Вам придется скачать с GitHub репозиторий с проектом. Для этого создайте какую нибудь папку, например
/chia-blockchain и клонируйте в неё репозиторий:
/chia-blockchain
git clone https://github.com/Chia-Network/chia-blockchain.git -b latest —recurse-submodules ./
Далее вам надо выполнить скрипт install.sh, который установит все необходимые зависимости:
После завершения установки надо выполнить такую команду, чтобы войти в виртуальное окружение Python и получить доступ к команде chia:
Если перед приглашением ввода команды появится слово (venv) значит вы все сделали верно. Теперь можете выполнить команду chia init для инициализации программы:
Затем для генерации приватного ключа кошелька выполните:
chia keys generate
Команда создаст новый ключ и выведет для него мнемоническую фразу. Её надо куда-нибудь записать для того чтобы можно было потом восстановит кошелёк:
Далее нужно запустить все сервисы Chia. Для этого выполните:
chia start farmer
Программа запустит такие сервисы: full-node, wallet, harvester, farmer. Вы можете запускать их также по отдельности. Теперь вы знаете как запустить chia на Ubuntu. Посмотреть информацию о доступных ключах можно командой:
В данном случае ключ только один, потому что выше ключи генерировались только один раз. У каждого ключа есть свой кошелёк. У них совпадают отпечатки (Fingerprint). Посмотреть информацию о кошельках можно выполнив команду:
chia wallet show
Узнать адрес кошелька, на который надо переводить деньги можно такой командой:
chia wallet get_address
Посмотреть состояние ноды в целом можно командой:
Майнинг chia можно условно разделить на две части. Это создание участков на диске (плотов), которые будут брать участие в дальнейшем майнинге и сам майнинг (фарминг). Сначала нужно создать эти участки. Для этого используйте команду chia plots create. Вот её синтаксис:
$ chia plots create параметры
Вот основные параметры, которые нужно использовать:
- -k — размер плота. В данный момент следует использовать k32;
- -n — количество плотов, которые нужно создать последовательно;
- -b — использование памяти в мегабайтах на каждый плот, по умолчанию 4608 Мб;
- -f — публичный ключ фермера, можно не задавать, тогда будет взято значение из конфигурационного файла. Этот параметр следует использовать только если вы хотите создать плоты для другой машины с другим кошельком.
- -p — публичный ключ пула, аналогично предыдущему;
- -t — папка для временных файлов, используется для первой и второй фазы генерации;
- -2 — папка для временных файлов, которая используется на третьей и четвертой фазе;
- -d — папка, в которую надо переместить готовый плот;
- -r — количество потоков процессора, по умолчанию 2;
- -u — количество корзин. Большее количество корзин требует меньше памяти, но больше обращений к диску. Для HDD лучше уменьшить этот параметр, для SSD не имеет значения;
Обратите внимание, что плоты создаются с ключом кошелька и использовать их можно только вместе с этим кошельком. Если вы захотите перенести плоты на другую машину, то кошелёк тоже надо будет переносить на другую машину, иначе ваши плоты будут не видны. Это сделано для защиты от двойного майнинга.
Вот команда, с помощью которой можно запустить плотинг chia ubuntu:
chia plots create -k 32 -b 4000 -r 2 -u 64 -t /путь/к/временной/папке -d /путь/к/папке/с/плотами
На создание одного плота на SSD может уйти до 5 часов, а на HDD все 10-15. После завершения создания вы можете посмотреть все плоты с помощью такой команды:
chia plots show
Остановить ноду chia и всё, что к ней относится можно выполнив команду:
Выводы
Теперь вы знаете как установить Chia на Ubuntu 20.04, как посмотреть свой кошелёк и начать фарминг, а также как управлять chia в терминале. Как видите, всё довольно просто. А как вы относитесь к криптовалюте Chia? Что о ней думаете? Напишите в комментариях!
Источник