Linux高產出自動挖Chia幣教程


 

1. 概述

  • chia挖礦分為兩個環節:P圖和挖礦
  • P圖環節
    • 用官方命令行P圖,
    • 用開源軟件Plotman管理和調度任務,並且可以實現任務暫停,恢復,清理。
  • 挖礦環節
    • 用官方圖形界面挖礦(本教程使用Ubuntu系統)

 

2. P圖步驟

1. 安裝chia-blockchain官方挖礦軟件(界面客戶端)

2. 准備緩存目錄和最終目錄

    • 批量創建目錄
for i in $(seq 1 12)   # 根據自己的磁盤數設置,這里是12個盤
do 
  mkdir /mnt/P$i/temp;   # 緩存目錄
    mkdir /mnt/P$i/plots;  # 最終目錄
  chmod -R 755 /mnt/P$i; # 設置寫入權限
done;

 

    • 掛載硬盤
# 根據自己的實際磁盤數設置
mount -t ext4 /dev/sdb1 /mnt/P1;
mount -t ext4 /dev/sdc1 /mnt/P2;

 

 

3. 安裝chia命令行和Plotman

注意:plotman直接使用界面版中自帶的chia命令會異常,因此需要單獨安裝chia命令

    • 安裝virtualenv
sudo pip install virtualenvwrapper
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
source ~/.bashrc
cd ~                           # 切換至用戶目錄
mkvirtualenv chia  # 創建chia環境
workon chia              # 切換至chia環境

 

    • 安裝chia命令行工具
pip install chia-blockchain

 

    • 安裝plotman
pip install plotman

 

    • 生成配置plotman
plotman config generate

 

    • 修改plotman配置
# Default/example plotman.yaml configuration file

# Options for display and rendering
user_interface:
        # Call out to the `stty` program to determine terminal size, instead of
        # relying on what is reported by the curses library.   In some cases,
        # the curses library fails to update on SIGWINCH signals.  If the
        # `plotman interactive` curses interface does not properly adjust when
        # you resize the terminal window, you can try setting this to True. 
        use_stty_size: True

# Where to plot and log.
directories:
        # One directory in which to store all plot job logs (the STDOUT/
        # STDERR of all plot jobs).  In order to monitor progress, plotman
        # reads these logs on a regular basis, so using a fast drive is
        # recommended.
        #  配置日志存放目錄,plotman依賴日志進行任務調度和進度分析
        log: /home/chia/chia/logs  

        # One or more directories to use as tmp dirs for plotting.  The
        # scheduler will use all of them and distribute jobs among them.
        # It assumes that IO is independent for each one (i.e., that each
        # one is on a different physical device).
        #
        # If multiple directories share a common prefix, reports will
        # abbreviate and show just the uniquely identifying suffix.
        # 設置緩存目錄
        tmp:
                - /mnt/P1/temp
                - /mnt/P2/temp
                - /mnt/P3/temp
                - /mnt/P4/temp

        # Optional: Allows overriding some characteristics of certain tmp
        # directories. This contains a map of tmp directory names to
        # attributes. If a tmp directory and attribute is not listed here,
        # it uses the default attribute setting from the main configuration.
        #
        # Currently support override parameters:
        #     - tmpdir_max_jobs
        # 設置每個緩存目錄最大並行任務數
        tmp_overrides:
                # In this example, /mnt/tmp/00 is larger than the other tmp
                # dirs and it can hold more plots than the default.
                "/mnt/P1/temp":
                        tmpdir_max_jobs: 5

        # Optional: tmp2 directory.  If specified, will be passed to
        # chia plots create as -2.  Only one tmp2 directory is supported.
        # tmp2: /mnt/tmp/a

        # One or more directories; the scheduler will use all of them.
        # These again are presumed to be on independent physical devices,
        # so writes (plot jobs) and reads (archivals) can be scheduled
        # to minimize IO contention.
        # 設置最終目錄,存放P好后的圖文件
        dst:
                - /mnt/P1/plots
                - /mnt/P2/plots

        # Archival configuration.  Optional; if you do not wish to run the
        # archiving operation, comment this section out.
        #
        # Currently archival depends on an rsync daemon running on the remote
        # host, and that the module is configured to match the local path.
        # See code for details.
        # 設置遠程歸檔目錄,即可以將P好的圖自動同步到遠程目錄,這里沒啟用
        # archive:
        #       rsyncd_module: plots
        #       rsyncd_path: /plots
        #       rsyncd_bwlimit: 80000  # Bandwidth limit in KB/s
        #       rsyncd_host: myfarmer
        #       rsyncd_user: chia
                # Optional index.  If omitted or set to 0, plotman will archive
                # to the first archive dir with free space.  If specified,
                # plotman will skip forward up to 'index' drives (if they exist).
                # This can be useful to reduce io contention on a drive on the
                # archive host if you have multiple plotters (simultaneous io
                # can still happen at the time a drive fills up.)  E.g., if you
                # have four plotters, you could set this to 0, 1, 2, and 3, on
                # the 4 machines, or 0, 1, 0, 1.
                #   index: 0


# Plotting scheduling parameters
scheduling:
        # Run a job on a particular temp dir only if the number of existing jobs
        # before tmpdir_stagger_phase_major tmpdir_stagger_phase_minor
        # is less than tmpdir_stagger_phase_limit.
        # Phase major corresponds to the plot phase, phase minor corresponds to
        # the table or table pair in sequence, phase limit corresponds to
        # the number of plots allowed before [phase major, phase minor]
        # 不限制每個階段的最大數
        tmpdir_stagger_phase_major: 99
        tmpdir_stagger_phase_minor: 99
        # Optional: default is 1
        tmpdir_stagger_phase_limit: 99

        # Don't run more than this many jobs at a time on a single temp dir.
        # 限制緩存目錄的最大並行數,會同時根據tmp_overrides的配置取最小值
        tmpdir_max_jobs: 12

        # Don't run more than this many jobs at a time in total.
        # 限制所有任務的總數最大值
        global_max_jobs: 12

        # Don't run any jobs (across all temp dirs) more often than this, in minutes.
        # 設置多長時間啟動一次任務(滿足前面的最大限制的情況下)
        global_stagger_m: 30

        # How often the daemon wakes to consider starting a new plot job, in seconds.
        # 設置多長時間輪詢一次狀態
        polling_time_s: 20


# Plotting parameters.  These are pass-through parameters to chia plots create.
# See documentation at
# https://github.com/Chia-Network/chia-blockchain/wiki/CLI-Commands-Reference#create
plotting:
        k: 32
        e: False             # Use -e plotting option
        # 設置線程數
        n_threads: 2         # Threads per job
        # 設置桶數
        n_buckets: 128       # Number of buckets to split data into
        # 設置最大內存
        job_buffer: 4608     # Per job memory
        # If specified, pass through to the -f and -p options.  See CLI reference.
        #   farmer_pk: ...
        #   pool_pk: ...
View Code

 

4. 啟動P圖

    • 初始化配置

啟動界面客戶端並登錄,在農田界面的右上角點擊三個點按鈕,添加農田文件目錄,對應/mnt/P1/plots (p1到P12,根據自己前面步驟中創建的目錄設置。等到P好圖存入到對應的目錄,會自動識別並挖礦

image.png

 

    • 啟動plotman開始自動P圖
plotman interactive  # 啟動可視化界面, 可視化界面第二行可以看到任務的總數和進度的整體分布情況。
# 如果無法啟動,也可以用: plotman plot 

image.png

 

3. 查看進度和收益

1. 查看P圖進度

watch plotman status

image.png

2. 查看日志分析

cd /home/chia/chia/logs  # 進入日志目錄
plotman analyze *.log    # 查看總數
plotman analyze 2021-04-28*.log   # 查看28日啟動的任務個階段耗時統計,單位:秒

image.png

3. 查看挖礦進度和收益

打開官方挖礦軟件查看挖礦進度和收益,P好的圖會自動導入並開始挖礦。

image.png

 

4. 附:投入產出數據參考

  • 投入合計成本:2.3W
  • 投入配置:
  型號 數量 單個參數 合計
CPU Xeon E5-2695 v4  2 18核,36線程 36核,72線程
內存 SK HYNIX HMA42GR7MFR4N-TF  8 16G 128G
主板 X10DRL-i 1    
固態硬盤 INTEL SSDPE7KX040T7 1 4T 4T
機械硬盤 希捷ST14000NM001G 12 14T 168T
  • 按以上配置投入3日,穩定后每日P圖約50個,合計空間5T,總計131個圖,12.9TiB,截至全網大小1.19EiB時,預計21天爆塊。(CPU和內存存在浪費,后續增加3塊SSD預計可以提升至每天25T)
  • 歡迎交流QQ群:790876237  
  • 原文:https://www.yuque.com/docs/share/b6c40b2a-3448-4d15-bcef-41c04bb2dd4a?# 《Linux高產出自動挖Chia幣教程》

image.png

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM