・2017/10/02
Orange Pi PC2の 64bit CPUパワーで 暗号通貨を採掘する(非実用)。CPU Miner cpuminer-multiで採掘する
(CPUパワーで 仮想通貨の採掘は非実用ですが、オレンジパイで動かす事が目的なので興味で動かす)
Tags: [Raspberry Pi], [Orange Pi], [電子工作], [海外通販], [通信販売]
● Orange Pi PC 2の CPUパワーで 暗号通貨を採掘する
ラズパイ3で動かしたので、比較として Orange Pi PC 2でも動かしてみます。
64ビットの恩恵は有るんでしょうか?
lucasjones/cpuminer-multi - Multi-algo CPUMiner & Reference Cryptonote Miner (JSON-RPC 2.0)
これの派生版として、
tpruvot/cpuminer-multi - crypto cpuminer (linux + windows) https://bitcointalk.org/?topic=841401
OhGodAPet/cpuminer-multi - Multi-algo CPUMiner 元:Wolf9466
MinerGate - CPUMiner-Multi by Wolf and Lucas Jones
● CPUMiner multiを Raspberry Pi 3でビルドする
下記に手順をまとめました。
・2017/10/02
Raspberry Pi 3の CPUパワーで 暗号通貨を採掘する(非実用)。CPU Miner cpuminer-multiで採掘する
CPUパワーで 仮想通貨の採掘は非実用ですが、ラズパイで動かす事が目的なので興味で動かす
● CPUMiner multiを Orange Pi PC 2で動かす
$ uname -a
Linux orangepipc2 4.13.5-sunxi64 #38 SMP Thu Oct 12 02:00:29 CEST 2017 aarch64 aarch64 aarch64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
● Orange PI PC2でビルド
そのままでは Orange PI PC2は 64bit ARMなのでビルドに失敗します。
対応として設定ファイルやソースファイルに aarch64を追加します。
configure.ac
case $target in
i*86-*-*)
have_x86=true
;;
x86_64-*-*|amd64-*-*)
have_x86_64=true
;;
arm*-*-*)
have_arm=true
;;
aarch64*-*-*)
have_arm=true
;;
esac
cpu-miner.c
~~
#if defined(__x86_64__) && defined(USE_XOP)
" XOP"
#endif
#if defined(__aarch64__)
" ARM64"
#endif
#if defined(USE_ASM) && defined(__arm__) && defined(__APCS_32__)
" ARM"
~~
#if !defined(__arm__) && !defined(__aarch64__)
static inline int cpuid(int code, uint32_t where[4]) {
asm volatile("cpuid":"=a"(*where),"=b"(*(where+1)),
"=c"(*(where+2)),"=d"(*(where+3)):"a"(code));
return (int)where[0];
}
#endif
static bool has_aes_ni()
{
#if defined(__arm__) || defined(__aarch64__)
return false;
#else
uint32_t cpu_info[4];
cpuid(1, cpu_info);
return cpu_info[2] & (1 << 25);
#endif
}
元ソースリストを Forkして、上記の修正を入れた物を私のブランチに用意しました。
FREEWING-JP/cpuminer-multi - aarch64 ARM64 patched
sudo apt-get update
sudo apt-get -y install automake libtool libssl-dev libcurl4-openssl-dev libjansson-dev
# aarch64 ARM64 patched lucasjones/cpuminer-multi
git clone https://github.com/FREEWING-JP/cpuminer-multi
cd cpuminer-multi
cat configure.ac | grep aarch64
./autogen.sh
./configure CFLAGS="-march=native"
make clean
make
$ ./minerd -V
cpuminer 1.0.4
built on Oct 14 2017
features: ARM64
libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
libjansson 2.7
$ ./minerd --bench
[2017-10-14 10:56:46] 3 miner threads started, using 'scrypt' algorithm.
[2017-10-14 10:56:46] ...retry after 10 seconds
[2017-10-14 10:56:52] thread 0: 4096 hashes, 0.66 khash/s
[2017-10-14 10:56:52] thread 2: 4096 hashes, 0.66 khash/s
[2017-10-14 10:56:52] thread 1: 4096 hashes, 0.66 khash/s
[2017-10-14 10:56:56] ...retry after 10 seconds
[2017-10-14 10:56:56] thread 0: 3300 hashes, 0.81 khash/s
[2017-10-14 10:56:56] thread 1: 3299 hashes, 0.81 khash/s
[2017-10-14 10:56:56] thread 2: 3300 hashes, 0.81 khash/s
[2017-10-14 10:56:56] Total: 2.43 khash/s
[2017-10-14 10:57:01] thread 2: 4055 hashes, 0.81 khash/s
[2017-10-14 10:57:01] Total: 2.43 khash/s
[2017-10-14 10:57:01] thread 1: 4055 hashes, 0.81 khash/s
[2017-10-14 10:57:01] thread 0: 4057 hashes, 0.79 khash/s
[2017-10-14 10:57:06] ...retry after 10 seconds
[2017-10-14 10:57:06] thread 0: 3964 hashes, 0.81 khash/s
[2017-10-14 10:57:06] thread 2: 4055 hashes, 0.81 khash/s
[2017-10-14 10:57:06] Total: 2.43 khash/s
$ ./minerd --benchmark -a sha256d
[2017-10-14 10:57:36] 3 miner threads started, using 'sha256d' algorithm.
[2017-10-14 10:57:36] ...retry after 10 seconds
[2017-10-14 10:57:40] thread 2: 2097152 hashes, 489.72 khash/s
[2017-10-14 10:57:40] thread 0: 2097152 hashes, 489.43 khash/s
[2017-10-14 10:57:40] thread 1: 2097152 hashes, 489.20 khash/s
[2017-10-14 10:57:45] thread 2: 2448621 hashes, 524.68 khash/s
[2017-10-14 10:57:45] Total: 1503 khash/s
[2017-10-14 10:57:45] thread 1: 2445990 hashes, 524.46 khash/s
[2017-10-14 10:57:45] thread 0: 2447136 hashes, 524.42 khash/s
[2017-10-14 10:57:46] ...retry after 10 seconds
[2017-10-14 10:57:50] thread 0: 2622082 hashes, 524.56 khash/s
[2017-10-14 10:57:50] thread 2: 2623378 hashes, 524.67 khash/s
[2017-10-14 10:57:50] Total: 1574 khash/s
[2017-10-14 10:57:50] thread 1: 2622304 hashes, 524.26 khash/s
[2017-10-14 10:57:55] thread 2: 2623332 hashes, 524.72 khash/s
[2017-10-14 10:57:55] Total: 1574 khash/s
● Orange PI PC2でビルド
Orange PI PC2は 64bit ARM対応の tpruvot版 tpruvot/cpuminer-multi。
tpruvot版は暗号の種類、計算方法が独自に追加されています。
tpruvot/cpuminer-multi crypto cpuminer (linux + windows) https://bitcointalk.org/?topic=841401
sudo apt-get update
sudo apt-get -y install automake autoconf pkg-config libtool libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev make g++
# Latest commit 477b5fa Oct 12, 2017
git clone https://github.com/tpruvot/cpuminer-multi
# git cloneでエラーが出る場合は
# git clone https://github.com/tpruvot/cpuminer-multi -b linux
cd cpuminer-multi
sed -i -e "s/^INCLUDES/AM_CPPFLAGS/g" Makefile.am
./autogen.sh
# Note for pi64 users:
./configure --disable-assembly CFLAGS="-Ofast -march=native" --with-crypto --with-curl
make clean
make
sudo make install
$ ./cpuminer -V
** cpuminer-multi 1.3.3 by tpruvot@github **
BTC donation address: 1FhDPLPpw18X4srecguG3MxJYe4a1JsZnd (tpruvot)
built with GCC 5.4.0 the Oct 14 2017
compiled for general use
config features:
libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
jansson/2.7
$ ./cpuminer --help
** cpuminer-multi 1.3.3 by tpruvot@github **
BTC donation address: 1FhDPLPpw18X4srecguG3MxJYe4a1JsZnd (tpruvot)
Usage: cpuminer-multi [OPTIONS]
Options:
-a, --algo=ALGO specify the algorithm to use
axiom Shabal-256 MemoHash
bitcore Timetravel with 10 algos
blake Blake-256 14-rounds (SFR)
blakecoin Blake-256 single sha256 merkle
blake2s Blake2-S (256)
bmw BMW 256
c11/flax C11
cryptolight Cryptonight-light
cryptonight Monero
decred Blake-256 14-rounds 180 bytes
dmd-gr Diamond-Groestl
drop Dropcoin
fresh Fresh
groestl GroestlCoin
heavy Heavy
jha JHA
keccak Keccak
luffa Luffa
lyra2re Lyra2RE
lyra2rev2 Lyra2REv2 (Vertcoin)
myr-gr Myriad-Groestl
neoscrypt NeoScrypt(128, 2, 1)
nist5 Nist5
pluck Pluck:128 (Supcoin)
pentablake Pentablake
quark Quark
qubit Qubit
scrypt scrypt(1024, 1, 1) (default)
scrypt:N scrypt(N, 1, 1)
scrypt-jane:N (with N factor from 4 to 30)
shavite3 Shavite3
sha256d SHA-256d
sia Blake2-B
sib X11 + gost (SibCoin)
skein Skein+Sha (Skeincoin)
skein2 Double Skein (Woodcoin)
s3 S3
timetravel Timetravel (Machinecoin)
vanilla Blake-256 8-rounds
x11evo Permuted x11
x11 X11
x13 X13
x14 X14
x15 X15
x17 X17
xevan Xevan (BitSend)
yescrypt Yescrypt
zr5 ZR5
-o, --url=URL URL of mining server
-O, --userpass=U:P username:password pair for mining server
-u, --user=USERNAME username for mining server
-p, --pass=PASSWORD password for mining server
--cert=FILE certificate for mining server using SSL
-x, --proxy=[PROTOCOL://]HOST[:PORT] connect through a proxy
-t, --threads=N number of miner threads (default: number of processors)
-r, --retries=N number of times to retry if a network call fails
(default: retry indefinitely)
-R, --retry-pause=N time to pause between retries, in seconds (default: 30)
--time-limit=N maximum time [s] to mine before exiting the program.
-T, --timeout=N timeout for long poll and stratum (default: 300 seconds)
-s, --scantime=N upper bound on time spent scanning current work when
long polling is unavailable, in seconds (default: 5)
--randomize Randomize scan range start to reduce duplicates
-f, --diff-factor Divide req. difficulty by this factor (std is 1.0)
-m, --diff-multiplier Multiply difficulty by this factor (std is 1.0)
-n, --nfactor neoscrypt N-Factor
--coinbase-addr=ADDR payout address for solo mining
--coinbase-sig=TEXT data to insert in the coinbase when possible
--max-log-rate limit per-core hashrate logs (default: 5s)
--no-longpoll disable long polling support
--no-getwork disable getwork support
--no-gbt disable getblocktemplate support
--no-stratum disable X-Stratum support
--no-extranonce disable Stratum extranonce support
--no-redirect ignore requests to change the URL of the mining server
-q, --quiet disable per-thread hashmeter output
--no-color disable colored output
-D, --debug enable debug output
-P, --protocol-dump verbose dump of protocol-level activities
--hide-diff Hide submitted block and net difficulty
-S, --syslog use system log for output messages
-B, --background run the miner in the background
--benchmark run in offline benchmark mode
--cputest debug hashes from cpu algorithms
--cpu-affinity set process affinity to cpu core(s), mask 0x3 for cores 0 and 1
--cpu-priority set process priority (default: 0 idle, 2 normal to 5 highest)
-b, --api-bind IP/Port for the miner API (default: 127.0.0.1:4048)
--api-remote Allow remote control
--max-temp=N Only mine if cpu temp is less than specified value (linux)
--max-rate=N[KMG] Only mine if net hashrate is less than specified value
--max-diff=N Only mine if net difficulty is less than specified value
-c, --config=FILE load a JSON-format configuration file
-V, --version display version information and exit
-h, --help display this help text and exit
$ ./cpuminer --bench
** cpuminer-multi 1.3.3 by tpruvot@github **
BTC donation address: 1FhDPLPpw18X4srecguG3MxJYe4a1JsZnd (tpruvot)
[2017-10-14 11:24:56] 4 miner threads started, using 'scrypt' algorithm.
[2017-10-14 11:24:58] CPU #0: 0.36 kH/s
[2017-10-14 11:24:58] CPU #1: 0.36 kH/s
[2017-10-14 11:24:58] CPU #2: 0.36 kH/s
[2017-10-14 11:24:58] CPU #3: 0.36 kH/s
[2017-10-14 11:24:58] Total: 1.44 kH/s
[2017-10-14 11:24:59] Total: 3.55 kH/s
[2017-10-14 11:25:01] Total: 3.55 kH/s
[2017-10-14 11:25:06] CPU #0: 0.89 kH/s
[2017-10-14 11:25:06] CPU #2: 0.89 kH/s
[2017-10-14 11:25:06] CPU #1: 0.88 kH/s
[2017-10-14 11:25:06] CPU #3: 0.89 kH/s
[2017-10-14 11:25:06] Total: 3.55 kH/s
[2017-10-14 11:25:11] Total: 3.55 kH/s
$ ./cpuminer --bench -a sha256d
** cpuminer-multi 1.3.3 by tpruvot@github **
BTC donation address: 1FhDPLPpw18X4srecguG3MxJYe4a1JsZnd (tpruvot)
[2017-10-14 11:25:28] 4 miner threads started, using 'sha256d' algorithm.
[2017-10-14 11:25:32] CPU #1: 526.21 kH/s
[2017-10-14 11:25:32] CPU #2: 526.22 kH/s
[2017-10-14 11:25:32] CPU #3: 526.25 kH/s
[2017-10-14 11:25:32] CPU #0: 524.44 kH/s
[2017-10-14 11:25:33] Total: 2103 kH/s
[2017-10-14 11:25:38] CPU #1: 526.20 kH/s
[2017-10-14 11:25:38] CPU #2: 526.17 kH/s
[2017-10-14 11:25:38] CPU #3: 526.26 kH/s
[2017-10-14 11:25:38] Total: 2103 kH/s
[2017-10-14 11:25:38] CPU #0: 524.52 kH/s
[2017-10-14 11:25:43] Total: 2103 kH/s
[2017-10-14 11:25:48] CPU #1: 526.26 kH/s
[2017-10-14 11:25:48] CPU #2: 526.15 kH/s
[2017-10-14 11:25:48] CPU #3: 526.15 kH/s
[2017-10-14 11:25:48] Total: 2103 kH/s
tpruvot版が対応している暗号計算方式(暗号通貨の一覧)
Currently supported
* scrypt (Litecoin, Dogecoin, Feathercoin, ...)
* scrypt:N
* scrypt-jane:N
* sha256d (Bitcoin, Freicoin, Peercoin/PPCoin, Terracoin, ...)
* axiom (Axiom Shabal-256 based MemoHash)
* bastion (Joincoin [J])
* bitcore Permuted serie of 10 algos (BitCore)
* blake (Saffron [SFR] Blake-256)
* blake2s (NevaCoin Blake2-S 256)
* bmw (Midnight [MDT] BMW-256)
* cryptonight (Bytecoin [BCN], Monero [XMR])
* cryptonight-light (Aeon)
* decred (Blake256-14 [DCR])
* dmd-gr (Diamond-Groestl)
* fresh (FreshCoin)
* groestl (Groestlcoin)
* jha (JackpotCoin, SweepStake)
* lbry (LBRY Credits [LBC])
* lyra2RE (Cryptocoin)
* lyra2REv2 (VertCoin [VTC])
* myr-gr Myriad-Groestl (MyriadCoin [MYR])
* neoscrypt (Feathercoin)
* nist5 (MistCoin [MIC], TalkCoin [TAC], ...)
* pentablake (Joincoin)
* pluck (Supcoin [SUP])
* quark (Quarkcoin)
* qubit (GeoCoin)
* skein (Skeincoin, Myriadcoin, Xedoscoin, ...)
* skein2 (Woodcoin)
* s3 (OneCoin)
* sia (Reversed Blake2B for SIA [SC])
* sib X11 + gost streebog (SibCoin)
* timetravel Permuted serie of 8 algos (MachineCoin [MAC])
* tribus 3 of the top NIST5 algos (Denarius [DNR])
* vanilla (Blake-256 8-rounds - double sha256 [VNL])
* veltor (Veltor [VLT])
* xevan x17 x 2 on bigger header (BitSend [BSD])
* x11evo (Revolver [XRE])
* x11 (Darkcoin [DRK], Hirocoin, Limecoin, ...)
* x13 (Sherlockcoin, [ACE], [B2B], [GRC], [XHC], ...)
* x14 (X14, Webcoin [WEB])
* x15 (RadianceCoin [RCE])
* x17 (Verge [XVG])
* yescrypt (GlobalBoostY [BSTY], Unitus [UIS], MyriadCoin [MYR])
* zr5 (Ziftrcoin [ZRC])
Tags: [Raspberry Pi], [Orange Pi], [電子工作], [海外通販], [通信販売]
●関連するコンテンツ(この記事を読んだ人は、次の記事も読んでいます)
FWinSdCardImager SDカード イメージ書き込みアプリ、ラズパイの Raspbian OS、Jetson Nanoの Ubuntuの書き込みに便利
ラズパイや Jetson Nano等のワンボードマイコン等への OSイメージの書き込みが簡単にできる
FWinPiFinder ラズベリーパイ IPアドレス発見アプリ。ARPコマンドでラズパイの IPアドレスを探索発見する
Raspberry Piや NVIDIA Jetson Nano等の IPアドレスを MACアドレスの OUI部分を使用して発見する
Raspberry Pi 3系のトラブルであるある第一位の電源トラブル、低電圧警報に関する情報のまとめ
ラズパイ3B系での低電圧警報に関する情報まとめ、コマンドラインやログファイルから低電圧を検知する方法
Raspberry Piで CPUの脆弱性 Spectreと Meltdownの脆弱性をチェックする方法
ラズパイで 2018年初頭に大騒ぎになったスペクターとメルトダウンの CPUの脆弱性をチェックする方法
Raspberry Pi Zero Wを海外通販の Pimoroni等での購入方法、購入できる通販ショップ一覧まとめ
ラズパイゼロW ワイヤレスモデルを海外通販でサクッと簡単に個人輸入で入手。技適通過でも国内販売は常に品切れ
Raspberry Pi 3で安定して使える相性の無い最適な microSDカードの種類のまとめ
ラズパイ3で安定して使える microSDカードを購入する Teamと SanDiskは絶対に買わない
Raspberry Pi 3 Model Bに専用カメラモジュール RaspiCamを接続する方法
ラズパイに専用カメラモジュールを接続して Raspbianで写真の静止画撮影や動画を録画する方法
Raspberry Pi 3の Linuxコンソール上で使用する各種コマンドまとめ
ラズパイの Raspbian OSのコマンドラインで使用する便利コマンド、負荷試験や CPUシリアル番号の確認方法等も
Raspberry Pi 3公式フォーラムの FAQの内容の日本語訳
ラズパイ公式フォーラムの「The Raspberry Pi 3 Model B Q&A thread」の日本語訳
Raspberry Pi 3で GPIO端子の I2C機能を有効化する方法
ラズパイ3の GPIO端子の I2C機能を有効にして各種センサーを繋げる方法まとめ
大人気の CPUボード、Raspberry Pi 3 Model Bで作ってみよう
Raspberry Piの開発環境の構築やタッチパネル付き液晶ディスプレイや各種センサーの使い方まとめ
Raspberry Pi関連はこちらへまとめました
下記以外にも多数のラズパイ関係の記事が有ります。
(I2C制御、GPIO制御、1-Wire制御、シリアル通信、日本語音声合成、日本語音声認識、中国語音声合成、MeCab 形態素解析エンジン、赤外線リモコン制御、秋月 I2C液晶モジュール、KeDei 3.5インチ液晶、HDMI 5インチ液晶、NFCカードリーダ、コマンドライン操作方法等)
Espressif ESP8266 Arduino互換でスケッチが使える ESP-12Eモジュール基板
Espressif ESP8266 ESP-12-E NodeMCU V1 ESP12 CP2102
BangGood通販はドローン以外にも面白い商品がまだまだ有った(電子工作編)
レーザー彫刻機、カラー液晶の DIYオシロ、Arduinoや Raspberry Pi用の小型カラー液晶
[HOME]
|
[BACK]
リンクフリー(連絡不要、ただしトップページ以外は Web構成の変更で移動する場合があります)
Copyright (c)
2017 FREE WING,Y.Sakamoto
Powered by 猫屋敷工房 & HTML Generator
http://www.neko.ne.jp/~freewing/raspberry_pi/orange_pi_pc2_bitcoin_mining_cpuminer/