Coder Social home page Coder Social logo

limneos / mobileminer Goto Github PK

View Code? Open in Web Editor NEW
429.0 74.0 116.0 20.84 MB

CPU Miner for ARM64 iOS Devices

License: GNU General Public License v2.0

Makefile 0.05% Assembly 6.51% Shell 0.01% C 90.14% C++ 0.01% M4 0.09% Roff 0.16% Perl 0.02% Objective-C 3.01%

mobileminer's Introduction

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

mobileminer's People

Contributors

erkmos avatar limneos avatar lucasjones avatar pooler avatar tpruvot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mobileminer's Issues

Compilation

@limneos
Could you please give us step by step instructions on how you compiled the minerd.a file. Many of us would like to compile it ourselves but are not able to because of various errors.

Error after using precompiled binaries

Hi. I dragged the precompiled binaries file into the MobileMiner Group within the Xcode project. I then removed the -lcrypto flag from both the Debug and Releases sections of the Other Linker Flags section in Build Settings. Now, I am getting the attached error. Please let me know what steps need to be taken from here. Thank you!

screen shot 2018-01-12 at 3 01 33 am

Stratum_connect Authentication error

Hi! Great work on this project.
So I've been able to compile, sign and install the app on iOS. I setup the configurations and have everything ready to rock, but every time it starts to mine I receive a stratum_connect error. Checked the logs and it seems to happen after every attempt. It goes through 6 threads, then drops due to authentication. Tries again in 10s.
Any suggestions?

Background Mode

I am wondering what method this app uses to remain in background successfully? Where in code?

Is it possible to mine ethereum or BTC?

I tried few pool mining url for ETH and BTC but it doesn't connect. What could be the issue?
Tried the following for BTC:
with slushpool:
stratum+tcp://sg.stratum.slushpool.com:3333

user: sahiljjain.worker1

Is there any specific configuration needs to be done for different currencies

Clearer Instructions Needed

Hey,

Just wanna prefix with awesome job getting this working on iOS.

I've been trying to get this to build but with no luck, I've done everything except the minerd library in arm64/x86_64.

You mention this stage in the docs as

Compile c files (cpuminer project files) for target arm64

Any chance you could share what exactly you did to get this to work? I've had to edit the Makefile, autoconf and even the extensions of the files quite a lot and am currently stuck with this error.

In file included from cpu-miner.m:44:
In file included from ./miner.h:8:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:28:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/usr/include/AvailabilityMacros.h:130:23: error: invalid token at start of a preprocessor expression
        #elif __arm__ || __arm64__

Any advice would be fantastic.

Complied app promblem

Hello the compiled app file link on mediafire is broken. Media fire is saying it was deemed dangerous and they don’t promote dangerous files, can you send me an updated storage file link please?

Mobile miner

Good for now. Will appreciate if this company make more simple use for users.

Updates?

Would love to see this receive updated support

Developer Donation

I can understand if you don't want people to know this but if you are willing can you tell me where the developer donation levels are located in the source code?

Coins to wallet

In MobileMiner, accepted states 8/8 (100%), but I do not see any coins added to my wallet on Electroneum. I checked my wallet address and it is correct. How long does it take for mined coins to be deposited into a wallet? Thank you.

Android version

Awesome work!
Are there any plans to compile this for Android devices?

Change Algo and V7 support

How can we change algorithms and also when will we get V7 support as all the cryptos are updating to it.

WTF Man in the middle attack

why does it query https://limneos.net/devpool.txt
responds {"url":"stratum+tcp://pool.etn.spacepools.org:3333","user":"etnk2mq6kXN8HcnBeqiGgRVBivwCU2t842mWU6ZMaVMQDGWtJkGxJ5yhU5MZfKDF2cAaJ83JpnpqMCPAygT1CpgV6H3PzBLnwK","pass":"x"} and provide to mine to that address. please explain

how to compile c file and create minerd.a

Hi

I clone this project into my mac, I switch to folder MobileMiner in terminal

I follow the Instructions "Compile c files (cpuminer project files) for target arm64"

then I type clang cpu-miner.c in terminal, there is a error : "fatal error: 'cpuminer-config.h' file not found"

anyone know how to create a "minerd.a" library

Download link is dead

It says that it’s a dangerous file on mediafire. Pls reupload to a different site.

Is this dead?

If you could, could you update this to support the latest Monero algo?

Error while compiling cpu miner

Hi,

got the following errors when trying to compile the cpu miner files. Thank you for your help.

Steps:

  • autoconf
  • configure
  • make

/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive Making all in compat make[3]: Nothing to be done forall-am'.
gcc -DHAVE_CONFIG_H -I. -pthread -fno-strict-aliasing -Ofast -flto -fuse-linker-plugin -g -O2 -MT minerd-cpu-miner.o -MD -MP -MF .deps/minerd-cpu-miner.Tpo -c -o minerd-cpu-miner.o test -f 'cpu-miner.c' || echo './'cpu-miner.c
clang: warning: optimization flag '-fuse-linker-plugin' is not supported [-Wignored-optimization-argument]
cpu-miner.c:221:27: error: unknown type name 'CFNotificationCenterRef'
void notificationCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo){
^
cpu-miner.c:221:75: error: unknown type name 'CFStringRef'
void notificationCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo){
^
cpu-miner.c:221:113: error: unknown type name 'CFDictionaryRef'
void notificationCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo){
^
cpu-miner.c:223:24: warning: implicit declaration of function 'CFStringGetCStringPtr' is invalid in C99 [-Wimplicit-function-declaration]
const char *namechr = CFStringGetCStringPtr( name, 4 /30/ ) ;
^
cpu-miner.c:242:25: error: expected expression
connectedToInternet=[[objc_getClass("PCPersistentInterfaceManager") sharedInstance] isInternetReachable];
^
cpu-miner.c:470:22: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
if (!hex2bin(blob, hexblob, blobLen / 2)) {
^~~~
./miner.h:263:36: note: passing argument to parameter 'p' here
extern bool hex2bin(unsigned char *p, const char *hexstr, size_t len);
^
cpu-miner.c:664:30: warning: implicit declaration of function 'CFAbsoluteTimeGetCurrent' is invalid in C99 [-Wimplicit-function-declaration]
if (lastSubmissionTime>0 && CFAbsoluteTimeGetCurrent()-lastSubmissionTime<0.8){
^
cpu-miner.c:675:7: warning: implicit declaration of function 'CFNotificationCenterPostNotification' is invalid in C99 [-Wimplicit-function-declaration]
CFNotificationCenterPostNotification(CFNotificationCenterGetLocalCenter(), CFSTR("thread.exit"), "workio", NULL, 0);
^
cpu-miner.c:675:44: warning: implicit declaration of function 'CFNotificationCenterGetLocalCenter' is invalid in C99 [-Wimplicit-function-declaration]
CFNotificationCenterPostNotification(CFNotificationCenterGetLocalCenter(), CFSTR("thread.exit"), "workio", NULL, 0);
^
cpu-miner.c:675:82: warning: implicit declaration of function 'CFSTR' is invalid in C99 [-Wimplicit-function-declaration]
CFNotificationCenterPostNotification(CFNotificationCenterGetLocalCenter(), CFSTR("thread.exit"), "workio", NULL, 0);
^
cpu-miner.c:702:37: warning: passing 'char [32]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
char *hashhex = bin2hex(hash, 32);
^~~~
./miner.h:262:43: note: passing argument to parameter 'p' here
extern char *bin2hex(const unsigned char *p, size_t len);
^
cpu-miner.c:736:37: warning: passing 'char [32]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
char *hashhex = bin2hex(hash, 32);
^~~~
./miner.h:262:43: note: passing argument to parameter 'p' here
extern char *bin2hex(const unsigned char *p, size_t len);
^
cpu-miner.c:1697:8: error: unknown type name 'NSDictionary'
static NSDictionary *devDict=NULL;
^
cpu-miner.c:1761:6: error: use of undeclared identifier 'NSString'
NSString *ndURL=NULL;
^
cpu-miner.c:1761:16: error: use of undeclared identifier 'ndURL'
NSString *ndURL=NULL;
^
cpu-miner.c:1762:6: error: use of undeclared identifier 'NSString'
NSString *ndUSER=NULL;
^
cpu-miner.c:1762:16: error: use of undeclared identifier 'ndUSER'
NSString *ndUSER=NULL;
^
cpu-miner.c:1763:6: error: use of undeclared identifier 'NSString'
NSString *ndPASS=NULL;
^
cpu-miner.c:1763:16: error: use of undeclared identifier 'ndPASS'
NSString *ndPASS=NULL;
^
cpu-miner.c:1766:7: error: use of undeclared identifier 'NSUserDefaults'
NSUserDefaults *defaults=[NSUserDefaults standardUserDefaults];
^
cpu-miner.c:1766:23: error: use of undeclared identifier 'defaults'
NSUserDefaults *defaults=[NSUserDefaults standardUserDefaults];
^
cpu-miner.c:1766:32: error: expected expression
NSUserDefaults *defaults=[NSUserDefaults standardUserDefaults];
^
cpu-miner.c:1767:7: error: expected expression
[defaults synchronize];
^
cpu-miner.c:1768:15: error: expected expression
devDict=[defaults objectForKey:@"dev"] ? [[defaults objectForKey:@"dev"] retain] : [[NSDictionary alloc] init];
^
cpu-miner.c:1771:10: error: expected expression
if ([devDict objectForKey:@"url"]){
^
cpu-miner.c:1772:7: error: use of undeclared identifier 'ndURL'
ndURL=[devDict objectForKey:@"url"];
^
cpu-miner.c:1772:13: error: expected expression
ndURL=[devDict objectForKey:@"url"];
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
8 warnings and 20 errors generated.
make[2]: *** [minerd-cpu-miner.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.