標籤彙整: 挖礦

XMR-Stak 指令參數挖 XMR 簡易教學

XMR-Stak 是一個挖 Monero (XMR) 的軟體,只要是同屬 CryptoNight 的競爭幣都可以使用。此軟體最大的特色就是可以同時使用 CPU 與顯示卡挖同一個幣種,而且只需開一個程式就能辦到。

XMR-Stak 2.5.x 的新版本中,只能使用 2.5.x 以上的設定檔,請重新產生一份乾淨的設定檔,詳細可以參考這個影片。
因應硬分岔, currency 請選 monero 或是 cryptonight_v8 。

經過影片的步驟後會得到新增的檔案如下:
config.txt (通用設定)
cpu.txt (CPU設定)
amd.txt nvidia.txt (顯卡設定)
pools.txt (礦池設定)
我們會拿以上的設定檔串成 .bat 或 .sh 檔

 


這裡以 XMR 為例,基本上不同幣種都是共用前 3 個檔案,只有 pools.txt 必須個別設置。我將 pools.txt 名稱改為 pools-xmr.txt ,同一個幣種都共用此檔案,先把此檔案打開。

"pool_list" :
[
{"pool_address" : "xmr.omine.org:5000", "wallet_address" : "43yG8CDmWgSiyxX9rxH7tfAz4E4VbrvvFFGSAMmaAKm4UL7T3MuKA8C6QMGmcuBUQbGGsFDFcrB5SZ1puboMFETd2ecoxVK#pc1", "rig_id" : "", "pool_password" : "", "use_nicehash" : false, "use_tls" : false, "tls_fingerprint" : "", "pool_weight" : 10 },
{"pool_address" : "xmr-asia1.nanopool.org:14444", "wallet_address" : "43yG8CDmWgSiyxX9rxH7tfAz4E4VbrvvFFGSAMmaAKm4UL7T3MuKA8C6QMGmcuBUQbGGsFDFcrB5SZ1puboMFETd2ecoxVK.pc1/trleee@gmail.com", "rig_id" : "", "pool_password" : "", "use_nicehash" : false, "use_tls" : false, "tls_fingerprint" : "", "pool_weight" : 1 },
],

我設定兩個礦池,並且給予不同的優先權,這樣若是礦池連不上就會換另一個。注意 rig_id 這個參數需要伺服器支援才能用,絕大部分都是在錢包地址上面加工,例如 "." "#" "/" 等字元請參考礦池網站說明。

接下來就是要打指令參數了。

xmr-stak ^
--config config.txt ^
--cpu cpu.txt ^
--amd amd.txt ^
--poolconf pools-xmr.txt ^
--url xmr.omine.org:5000 ^
--user 43yG8CDmWgSiyxX9rxH7tfAz4E4VbrvvFFGSAMmaAKm4UL7T3MuKA8C6QMGmcuBUQbGGsFDFcrB5SZ1puboMFETd2ecoxVK#pc1

每行最後的 “ ^” 是為了斷行,這樣看得比較清楚。若是 Linux 及 Mac 的使用者請使用 ” \” 。

你可能會發現 --url 與 --user 分別對應 pools-xmr.txt 中的 pool_address 與 wallet_address ,為什麼這邊還要再寫一次?因為指令的優先權會大於 pools-xmr.txt 中的 pool_list 設定,假如你今天想挖第 2 個礦池,用指令覆蓋就好不須變動 pools-xmr.txt 檔案。

假設你想要暫時關閉顯示卡挖礦,則直接用指令 --noAMD 與 --noNVIDIA 禁用就好,也不須變動 amd.txt 和 nvidia.txt ,我分別對 GPU 啟用與禁用的兩種情況建立指令,依照心情隨時切換。

xmr-stak ^
--config config.txt ^
--cpu cpu.txt ^
--amd amd.txt ^
--poolconf pools-xmr.txt ^
--url xmr.omine.org:5000 ^
--user 43yG8CDmWgSiyxX9rxH7tfAz4E4VbrvvFFGSAMmaAKm4UL7T3MuKA8C6QMGmcuBUQbGGsFDFcrB5SZ1puboMFETd2ecoxVK#pc1 ^
--noAMD ^
--noNVIDIA

最後將指令存成 .bat (Windows) 與 .sh (Linux Mac) 再執行就可以開挖囉。

台灣最大 XMR 礦池
https://xmr.omine.org/

 


附上官方指令參數說明


Usage: xmr-stak [OPTION]...

  -h, --help                 show this help
  -v, --version              show version number
  -V, --version-long         show long version number
  -c, --config FILE          common miner configuration file
  -C, --poolconf FILE        pool configuration file
  --noUAC                    disable the UAC dialog
  --benchmark BLOCKVERSION   ONLY do a benchmark and exit
  --benchwait WAIT_SEC             ... benchmark wait time
  --benchwork WORK_SEC             ... benchmark work time
  --noCPU                    disable the CPU miner backend
  --cpu FILE                 CPU backend miner config file
  --noAMD                    disable the AMD miner backend
  --noAMDCache               disable the AMD(OpenCL) cache for precompiled binaries
  --openCLVendor VENDOR      use OpenCL driver of VENDOR and devices [AMD,NVIDIA]
                             default: AMD
  --amd FILE                 AMD backend miner config file
  --noNVIDIA                 disable the NVIDIA miner backend
  --nvidia FILE              NVIDIA backend miner config file
  -i --httpd HTTP_PORT       HTTP interface port

The following options can be used for automatic start without a guided config,
If config exists then this pool will be top priority.
  -o, --url URL              pool url and port, e.g. pool.usxmrpool.com:3333
  -O, --tls-url URL          TLS pool url and port, e.g. pool.usxmrpool.com:10443
  -u, --user USERNAME        pool user name or wallet address
  -r, --rigid RIGID          rig identifier for pool-side statistics (needs pool support)
  -p, --pass PASSWD          pool password, in the most cases x or empty ""
  --use-nicehash             the pool should run in nicehash mode
  --currency NAME            currency to mine

Environment variables:

  XMRSTAK_NOWAIT             disable the dialog `Press any key to exit.
                                    for non UAC execution

Supported coin options:
        - aeon7
        - bbscoin
        - bittube
        - cryptonight
        - cryptonight_bittube2
        - cryptonight_masari
        - cryptonight_haven
        - cryptonight_heavy
        - cryptonight_lite
        - cryptonight_lite_v7
        - cryptonight_lite_v7_xor
        - cryptonight_v7
        - cryptonight_v8
        - cryptonight_v7_stellite
        - graft
        - haven
        - intense
        - masari
        - monero
        - qrl
        - ryo
        - stellite
        - turtlecoin

Version: xmr-stak 2.5.1 4e72408ff
Brought to by fireice_uk and psychocrypt under GPLv3.
Press any key to exit.

ethminer 新版指令參數挖 ETH 簡易教學

ethminer 是一個挖 Ethereum (ETH) 的軟體,只要是同屬 Ethash 的競爭幣都可以使用。此軟體最大的特色是沒有開發者抽成,當然也不需要自己去編譯了。

ethminer 0.14.0 的新版本中,已準備棄用多個與礦池有關的參數,目前舊的參數還是可以使用但會顯示警告,並在未來的版本將會移除,以下的參數會被一行的 -P 所取代。

-F, --farm, -FF, -SF, -FS, --farm-failover, --stratum-failover, -S, --stratum, -O, --userpass, -SP, --stratum-protocol, --stratum-ssl, -FO, --failover-userpass, -u, --user, -p, --pass, -o, --port, -fu, --failover-user, -fp, --failover-pass, -fo, --failover-port

 


舊版
ethminer ^
-S eth.gpumine.org:3333 ^
-FS eth2.gpumine.org:4333 ^
-O 0xFdd43923340736FfBcB31C808aC644922c1dF05d.pc1 ^
-SP 1 ^
-RH ^
--farm-recheck 200 ^
-G

新版
ethminer ^
-P stratum1+tcp://0xFdd43923340736FfBcB31C808aC644922c1dF05d.pc1@eth.gpumine.org:3333 ^
-P stratum1+tcp://0xFdd43923340736FfBcB31C808aC644922c1dF05d.pc1@eth2.gpumine.org:4333 ^
-RH ^
--farm-recheck 200 ^
-G

每行最後的 " ^" 是為了斷行,這樣看得比較清楚。若是 Linux 及 Mac 的使用者請使用 " \" 。

其中要特別說明的是 stratum1+tcp:// ,如果是 getwork 就要填 http ,如果是 stratum 則可以填以下任一個
stratum+ssl
stratum+tcp
stratum+tls
stratum+tls12
stratum1+ssl
stratum1+tcp
stratum1+tls
stratum1+tls12
stratum2+ssl
stratum2+tcp
stratum2+tls
stratum2+tls12

你可以發現上面那一大坨有些只差在數字,前者對應 -SP --stratum-protocol ,後者則對應 --stratum-ssl ,不過最常用的還是 tcp 和 ssl 啦。

最後將指令存成 .bat (Windows) 與 .sh (Linux Mac) 再執行就可以開挖囉。

台灣兩大 ETH 礦池
https://eth-tw.gpumine.org/
https://www.tweth.tw/

 


附上官方指令參數說明


Usage ethminer [OPTIONS]
Options:

Work farming mode:
-F,--farm <url> (deprecated) Put into mining farm mode with the work server at URL (default: http://127.0.0.1:8545)
-FF,-FO, --farm-failover, --stratum-failover <url> (deprecated) Failover getwork/stratum URL (default: disabled)
--farm-retries <n> Number of retries until switch to failover (default: 3)
-S, --stratum <host:port> (deprecated) Put into stratum mode with the stratum server at host:port
-SF, --stratum-failover <host:port> (deprecated) Failover stratum server at host:port
-O, --userpass <username.workername:password> (deprecated) Stratum login credentials
-FO, --failover-userpass <username.workername:password> (deprecated) Failover stratum login credentials (optional, will use normal credentials when omitted)
--work-timeout <n> reconnect/failover after n seconds of working on the same (stratum) job. Defaults to 180. Don't set lower than max. avg. block time
--stratum-ssl [<n>] (deprecated) Use encryption to connect to stratum server.
0: Force TLS1.2 (default)
1: Allow any TLS version
2: Allow self-signed or invalid certs and any TLS version
-SP, --stratum-protocol <n> (deprecated) Choose which stratum protocol to use:
0: official stratum spec: ethpool, ethermine, coinotron, mph, nanopool (default)
1: eth-proxy compatible: dwarfpool, f2pool, nanopool (required for hashrate reporting to work with nanopool)
2: EthereumStratum/1.0.0: nicehash
-RH, --report-hashrate Report current hashrate to pool (please only enable on pools supporting this)
-HWMON [<n>], Displays gpu temp, fan percent and power usage. Note: In linux, the program uses sysfs, which may require running with root privileges.
0: Displays only temp and fan percent (default)
1: Also displays power usage
--exit Stops the miner whenever an error is encountered
-SE, --stratum-email <s> Email address used in eth-proxy (optional)
--farm-recheck <n> Leave n ms between checks for changed work (default: 500). When using stratum, use a high value (i.e. 2000) to get more stable hashrate output
-P URL Specify a pool URL. Can be used multiple times. The 1st for for the primary pool, and the 2nd for the failover pool.
URL takes the form: scheme://user[:password]@hostname:port[/emailaddress].
for getwork use one of the following schemes:
http
for stratum use one of the following schemes:
stratum+ssl stratum+tcp stratum+tls stratum+tls12 stratum1+ssl stratum1+tcp stratum1+tls stratum1+tls12 stratum2+ssl stratum2+tcp stratum2+tls stratum2+tls12
Example 1 : stratum+ssl://0x012345678901234567890234567890123.miner1@ethermine.org:5555
Example 2 : stratum1+tcp://0x012345678901234567890234567890123.miner1@nanopool.org:9999/john.doe@gmail.com
Example 3 : stratum1+tcp://0x012345678901234567890234567890123@nanopool.org:9999/miner1/john.doe@gmail.com

Benchmarking mode:
-M [<n>],--benchmark [<n>] Benchmark for mining and exit; Optionally specify block number to benchmark against specific DAG.
--benchmark-warmup <seconds> Set the duration of warmup for the benchmark tests (default: 3).
--benchmark-trial <seconds> Set the duration for each trial for the benchmark tests (default: 3).
--benchmark-trials <n> Set the number of benchmark trials to run (default: 5).
Simulation mode:
-Z [<n>],--simulation [<n>] Mining test mode. Used to validate kernel optimizations. Optionally specify block number.
Mining configuration:
-G,--opencl When mining use the GPU via OpenCL.
-U,--cuda When mining use the GPU via CUDA.
-X,--cuda-opencl Use OpenCL + CUDA in a system with mixed AMD/Nvidia cards. May require setting --opencl-platform 1 or 2. Use --list-devices option to check which platform is your AMD.
--opencl-platform <n> When mining using -G/--opencl use OpenCL platform n (default: 0).
--opencl-device <n> When mining using -G/--opencl use OpenCL device n (default: 0).
--opencl-devices <0 1 ..n> Select which OpenCL devices to mine on. Default is to use all
-t, --mining-threads <n> Limit number of CPU/GPU miners to n (default: use everything available on selected platform)
--list-devices List the detected OpenCL/CUDA devices and exit. Should be combined with -G, -U, or -X flag
--display-interval <n> Set mining stats display interval in seconds. (default: every 5 seconds)
-L, --dag-load-mode <mode> DAG generation mode.
parallel - load DAG on all GPUs at the same time (default)
sequential - load DAG on GPUs one after another. Use this when the miner crashes during DAG generation
single <n> - generate DAG on device n, then copy to other devices
OpenCL configuration:
--cl-kernel <n> Use a different OpenCL kernel (default: use stable kernel)
0: stable kernel
1: experimental kernel
--cl-local-work Set the OpenCL local work size. Default is 128
--cl-global-work Set the OpenCL global work size as a multiple of the local work size. Default is 8192 * 128
--cl-parallel-hash <1 2 ..8> Define how many threads to associate per hash. Default=8
CUDA configuration:
--cuda-block-size Set the CUDA block work size. Default is 128
--cuda-grid-size Set the CUDA grid size. Default is 8192
--cuda-streams Set the number of CUDA streams. Default is 2
--cuda-schedule <mode> Set the schedule mode for CUDA threads waiting for CUDA devices to finish work. Default is 'sync'. Possible values are:
auto - Uses a heuristic based on the number of active CUDA contexts in the process C and the number of logical processors in the system P. If C > P, then yield else spin.
spin - Instruct CUDA to actively spin when waiting for results from the device.
yield - Instruct CUDA to yield its thread when waiting for results from the device.
sync - Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the results from the device.
--cuda-devices <0 1 ..n> Select which CUDA GPUs to mine on. Default is to use all
--cuda-parallel-hash <1 2 ..8> Define how many hashes to calculate in a kernel, can be scaled to achieve better performance. Default=4
--cuda-noeval bypass host software re-evaluation of GPU solutions.
This will trim some milliseconds off the time it takes to send a result to the pool.
Use at your own risk! If GPU generates errored results they WILL be forwarded to the pool
Not recommended at high overclock.
API core configuration:
--api-port Set the api port, the miner should listen to. Use 0 to disable. Default=0, use negative numbers to run in readonly mode. for example -3333.
General Options:
-v,--verbosity <0 - 9> Set the log verbosity from 0 to 9 (default: 5). Set to 9 for switch time logging.
-V,--version Show the version and exit.
-h,--help Show this help message and exit.
Environment variables:
NO_COLOR - set to any value to disable color output. Unset to re-enable color output.