LoginSignup
3
6

More than 5 years have passed since last update.

ethOSでcpuminerを稼働させる

Last updated at Posted at 2017-12-23

マイニング向けLinuxディストリビューションのethOS 1.2.5以上にて、bitZeny向けのcpuminerを自動稼働させたい

下準備

そもそもethOSでは、下手にapt-getなどでupdateすると、独自組み入れのミドルウェアなどが書き換わるなどするから動作保証しない、と言われるので、とりあえず必要なパッケージいれるだけにする。
まあいれる工程でアップデートしろとか色々言われると思うが、それはさせちゃう感じで入れてみる。

$ sudo apt-get-ubuntu update
$ sudo apt-get-ubuntu install git libcurl4-openssl-dev gcc-mingw-w64 automake gcc make

git clone & make

$ git clone https://github.com/bitzeny/cpuminer.git cpuminer
$ cd cpuminer/
$ ./autogen.sh
$ ./configure CFLAGS="-O3"
$ make

./configureの引数値は、ハイフン・オー・スリーで、ゼロ・スリーじゃないので注意

稼働させてみる

例:

$ ./minerd -a yescrypt -o stratum+tcp://stratum.misosi.ru:16001 -u USERNAME.WORKER_NAME -p PASSWORD

今回bitzenyマイニングプールはみそスープールを使う。

  1. 新規登録する
  2. ログインする
  3. メニューから My Workers 開く
    • スクリーンショット 2017-12-23 14.14.16.png
  4. Workerを登録する
    • スクリーンショット 2017-12-23 14.14.38.png
  5. Workerが登録された
    • スクリーンショット 2017-12-23 14.14.52.png

そうしたら、↓このように登録した情報をつかって起動させる

$ ./minerd -a yescrypt -o stratum+tcp://stratum.misosi.ru:16001 -u sakadon.Unko -p Tintin
[2017-12-22 23:21:06] 2 miner threads started, using 'yescrypt' algorithm.
[2017-12-22 23:21:06] Binding thread 0 to cpu 0
[2017-12-22 23:21:06] Starting Stratum on stratum+tcp://stratum.misosi.ru:16001
[2017-12-22 23:21:06] Binding thread 1 to cpu 1
[2017-12-22 23:21:06] Stratum requested work restart
[2017-12-22 23:21:15] thread 0: 4096 hashes, 0.52 khash/s
[2017-12-22 23:21:15] thread 1: 4096 hashes, 0.51 khash/s
...

↑こんなふうになったら成功

custom.sh 登録

標準で用意されているこのshell scriptに書いておくと、ethos-overclockなどのinitializeが終わった後に稼働なされるので、以下のように稼働が成功した起動コマンドをいれておくと便利。

尚、/home/ethos/にあるので、pathに注意。後念のため、タイムラグを作る。

custom.sh
#!/bin/bash
# /home/ethos/custom.sh
# This file is where you should put any custom scripting you would like to run. 
# It will run once, after Xorg (Graphical interface) starts up, any commands which you absolutely have to run before xorg should be located in rc.local before the "exit 0"
# All scripting in this file should be before the "exit 0" as well.  Preface any commands which require 'root' privileges with the "sudo" command
# Examples script running as user ethos: 
# my_command --my flags
# Example of a php script running as user root:
# sudo php /path/to/my/script.php

sleep 5s
./cpuminer/minerd -a yescrypt -o stratum+tcp://stratum.misosi.ru:16001 -u sakadon.Unko -p Tintin >/dev/null 2>&1

exit 0

コマンドの最後に>/dev/null 2>&1 を足したが、お好みで。

再起動試験

$ r

で再起動したあとに、ちゃんと稼働するか見る。

3
6
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
6