CPU Miner for ARM64 iOS Devices
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
MobileMiner.xcodeproj Included whole XCode project Dec 21, 2017
MobileMiner Removed pre-compiled binaries Dec 21, 2017
Precompiled Binaries Added Precompiled Binaries Dec 28, 2017
compat Initial commit Apr 23, 2014
crypto Fix memory leak Jul 3, 2014
scryptjane Initial commit Apr 23, 2014
sha3 Add X13/14/15 SHA3 algos (hamsi,fugue,shabal,whirlpool) Aug 2, 2014
.gitattributes Add skein support Apr 23, 2014
.gitignore New version 1.0.4, update README, NEWS Aug 2, 2014
.travis.yml Update .travis.yml Aug 6, 2015
AUTHORS Update AUTHORS Dec 20, 2017
COPYING Initial commit Apr 23, 2014
ChangeLog Initial commit Apr 23, 2014
Dockerfile Initial commit Apr 23, 2014
LICENSE Create LICENSE Dec 21, 2017
Makefile.am Fix compilation on ARM Aug 6, 2015
NEWS Add Freshcoin algo (fresh) Aug 2, 2014
README.md Added Precompiled Binaries Dec 28, 2017
aesb-arm.S Fix compilation on ARM Aug 6, 2015
aesb-x64.S Small optimizations May 24, 2014
aesb-x86.S Move x86 mul128 implementation May 25, 2014
autogen.sh Fix file permissions Apr 23, 2014
blake.c resolve quark/blake variable name conflict Aug 2, 2014
compat.h Initial commit Apr 23, 2014
configure.ac New version 1.0.4, update README, NEWS Aug 2, 2014
cpu-miner.c Included whole XCode project Dec 21, 2017
cryptonight.c Updated Xcode-related changes Dec 21, 2017
elist.h Initial commit Apr 23, 2014
example-cfg.json Initial commit Apr 23, 2014
fresh.c Add Freshcoin algo (fresh) Aug 2, 2014
heavy.c fix output of khash/s and increase hashes_done size Aug 2, 2014
ink.c fix output of khash/s and increase hashes_done size Aug 2, 2014
keccak.c fix output of khash/s and increase hashes_done size Aug 2, 2014
miner.h Updated Xcode-related changes Dec 21, 2017
minerd.1 Add support for scrypt(N, 1, 1) Aug 2, 2014
nomacro.pl Initial commit Apr 23, 2014
quark.c resolve quark/blake variable name conflict Aug 2, 2014
scrypt-arm.S Add a configure option to disable assembly code Aug 2, 2014
scrypt-x64.S Add a configure option to disable assembly code Aug 2, 2014
scrypt-x86.S Add a configure option to disable assembly code Aug 2, 2014
scrypt.c fix output of khash/s and increase hashes_done size Aug 2, 2014
sha2-arm.S Add a configure option to disable assembly code Aug 2, 2014
sha2-x64.S Add a configure option to disable assembly code Aug 2, 2014
sha2-x86.S Add a configure option to disable assembly code Aug 2, 2014
sha2.c fix output of khash/s and increase hashes_done size Aug 2, 2014
skein.c fix output of khash/s and increase hashes_done size Aug 2, 2014
util.c Updated Xcode-related changes Dec 21, 2017
x11.c fix output of khash/s and increase hashes_done size Aug 2, 2014
x13.c Add Freshcoin algo (fresh) Aug 2, 2014
x14.c Add Freshcoin algo (fresh) Aug 2, 2014
x15.c Add Freshcoin algo (fresh) Aug 2, 2014

README.md

MobileMiner

CPU Miner for ARM64 iOS Devices

This is a fork of Lucas Jones's cpuminer-multi, ( https://github.com/lucasjones/cpuminer-multi ) compiled for arm64 iOS devices. Credits go to the initial developers and contributors.

Compiled iOS App

http://www.mediafire.com/file/f6qzt8jv26wtqm6/MobileMiner.ipa

Changes

  1. The change needed is in cpu-miner.c, where

     int main(int argc, char *arv[])    
    

has been changed to

start_mining(int argc,char *argv[])

in order for it to compile as a library.

Then you can import the library in an Xcode project and use

char *args[]= {path, "-a","cryptonight","-o","url","-u","userAdrress","-p","x"};

start_mining((int)(sizeof(args)/sizeof(char *))-1,args);

if you want to keep the same argument formatting and parsing.

  1. In order for notifications to be received in the UI, instead of reading from stderr, I am posting notifications from inside cpu-miner.c passing the log message to the UI.

  2. I have added a throttle in submit_upstream_work in order to maintain the speed in reasonable limits, since I noticed that some pools might ban you if a) the pool has small startup diff b) the device can cope well at first with this diff and sends hashes very fast.

  3. I've added -x objective-c in the Makefile in order to compile with objc.

  4. Included necessary CoreFoundation framework for the C functions.

  5. In the case of the program being loaded as a library, flags need to be set inside threads in order to be able to stop them, because we don't want them to exit the main thread when done (although its faster to kill and restart the app if you're caught in a processing miner thread)

Dependencies

Jansson https://github.com/akheron/jansson

curl for iOS https://github.com/sinofool/build-libcurl-ios

openssl for iOS https://github.com/x2on/OpenSSL-for-iPhone

Instructions

  • Compile c files (cpuminer project files) for target arm64

  • After compile, run

              ar cru minerd.a minerd-cpu-miner.o minerd-util.o minerd-sha2.o minerd-scrypt.o minerd-keccak.o minerd-heavy.o minerd-quark.o minerd-skein.o minerd-ink.o minerd-blake.o minerd-cryptonight.o minerd-fresh.o minerd-x11.o minerd-x13.o minerd-x14.o minerd-x15.o sha3/minerd-sph_keccak.o sha3/minerd-sph_hefty1.o sha3/minerd-sph_groestl.o sha3/minerd-sph_skein.o sha3/minerd-sph_bmw.o sha3/minerd-sph_jh.o sha3/minerd-sph_shavite.o sha3/minerd-sph_blake.o sha3/minerd-sph_luffa.o sha3/minerd-sph_cubehash.o sha3/minerd-sph_simd.o sha3/minerd-sph_echo.o sha3/minerd-sph_hamsi.o sha3/minerd-sph_fugue.o sha3/minerd-sph_shabal.o sha3/minerd-sph_whirlpool.o crypto/minerd-oaes_lib.o crypto/minerd-c_keccak.o crypto/minerd-c_groestl.o crypto/minerd-c_blake256.o crypto/minerd-c_jh.o crypto/minerd-c_skein.o crypto/minerd-hash.o crypto/minerd-aesb.o   minerd-sha2-arm.o minerd-scrypt-arm.o minerd-aesb-arm.o crypto/minerd-aesb-x86-impl.o
    
  • This will create a "minerd.a" library. Drag minerd.a in Xcode

  • Compile openssl for iOS and drag libcrypto.a in Xcode project

  • Compile jansson for iOS and drag libjansson.a to Xcode project

  • Compile Curl for iOS and drag libcurl.a to Xcode project

  • (If you're having problems compiling or prefer precompiled binaries of the cpuminer project and dependencies , I am alternatively including them in Precompiled Binaries folder, just drag them in the Xcode project.)

      Other Flags: -all_load 
    
  • Compile Xcode project and run