Skip to content

Commit

Permalink
Merge pull request #17 from ShorelineCrypto/v1.4.x_MobileMining
Browse files Browse the repository at this point in the history
V1.4.x mobile mining
  • Loading branch information
ShorelineCrypto authored Aug 30, 2020
2 parents 2e7d91f + f92dd5c commit a55a939
Show file tree
Hide file tree
Showing 89 changed files with 1,061 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mobile Mining on Android 64 bits phone (arm64) with UserLand App
# Mobile Mining on Android phone arm64 or armhf with UserLand App

This folder describe how to CPU mine NewEnglandcoin (NENG) in 64 bits android phone (arm64) through UserLand app inside a linux terminal. UserLand app is an open-source app that can run linux inside your android phone.
This folder describe how to CPU mine NewEnglandcoin (NENG) in android phone on 64 bits (arm64) or 32 bits (armhf) through UserLand app inside a linux terminal. UserLand app is an open-source app that can run linux inside your android phone.

- Minimum hardware requirement: 2G memory phone with 3G spare hard disk.
- Software Required: UserLand app from Google Play Store or F-Droid
Expand All @@ -20,14 +20,32 @@ https://www.youtube.com/watch?v=BkP6FTy0a4Y&t=307s

Not trying to create a flaming war. Understanding the relationship between android vs linux, then you will clearly know what we did on NENG android CPU mining through UserLand app inside a linux terminal at almost native OS speed.

## Determine your Platform is 64 bits arm64 or 32 bits armhf

In newest android phone or arm chromebook, we expect 64 bits arm64 (aarch64) should be the norm. In older android phone or chromebook such as Samsung Galaxy Tab S4 on Android 9, it may be armhf platform. In the rare cases, your phone or chromebook may have 64 bits CPU, but the linux runs on 32 bits armhf. You can first run below two commands to determine what is your linux architecture on linux terminal either in Debian or Ubuntu after SSH installation.

```
uname -a
sudo apt-get update
```

Above information from terminal should give you clear idea whether you have arm64 (aarch64) or armhf platform in linux.

## Debian or Ubuntu?

UserLand app offers 4 linux distros (Alpine, Arch, Debian, Ubuntu). Currently for NewEnglandcoin android mining, two distros are supported and tested: Debian and Ubuntu.

UserLand Debian runs Debian 10 (buster) on arm64. UserLand ubuntu runs Ubuntu 18.04 on arm64. The UserLand LXDE or XFCE desktop installation session uses Debian.
UserLand Debian runs Debian 10 (buster) on arm64/armhf. UserLand ubuntu runs Ubuntu 18.04 on arm64/armhf. The UserLand LXDE or XFCE desktop installation session uses Debian.

Either distro is fine with similar user experience. If you are interested in desktop offering, Debian is preferred. If you encounter hardware compatibility issues,
Ubuntu 18.04 is preferred.

## Ubuntu 18.04 Alternative to Fix Potential Hardware Issue

Arm hardware may have hardware compatibility issues. This situation is worse on 32 bits arm platform. You can suspect a hardware issue if you run into error like "error while loading shared libraries: libboost_system.so.1.58.0". Or NENG wallet may run, but crash within 1 or 2 hours.

Here we provide a Ubuntu 18.04 NENG wallet method where you can compile Boost library from source. With self-compiled boost library from source together with NENG binary wallet file, the hardware compatibility issue should be fixed.

Either distro is fine with similar user experience. If you are interested in desktop offering, Debian is preferred.

## Linux Terminal (SSH) or Desktop (VNC or XSDL)?

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
74 changes: 74 additions & 0 deletions doc/Android_Userland_App/debian/armhf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Mobile Mining on Android 32 bits phone (armhf) with UserLand App

This folder describe how to CPU mine NewEnglandcoin (NENG) on 32 bits android phone (armhf).

Please read high level overview first from pdf report:
https://github.com/ShorelineCrypto/NewEnglandCoin/releases/download/NENG_2020_Q3_report/NENG_2020_Q3_report.pdf


### Step 1: Install and setup UserLand app from Google Play Store

First install free "UserLand" app from google play store. After installation, click Distribution
"Debian", pick a username, password, and VNC password (which could be same password). You will enter
a linux terminal inside UserLand app, which runs armhf version of Debian 10 (Buster).

Here we are recommending running through SSH (linux terminal) only, not VNC. For linux GUI, it is much better to run remotely
through putty and you can display all linux GUI software in windows 10 with a few mouse clicks of free software download and installs. See optional
item at bottom of the parent page.

### Step 2: prepare UserLand

Type below commands in linux terminal inside Userland:

```
sudo apt update
sudo apt install wget ssh
hostname -I
```

### Step 3: Remember IP of phone from above step, remote login from desktop computer

For windows 10 desktop machine, install a free software "PuTTY", login into phone with your
username/password picked at port 2022

A screen shot of putty was provided.

For linux or MacOS, you can remote login with ssh from command line at port 2022. For example
IP = 192.168.1.4 with user "hlu" like below
```
ssh [email protected] -p 2022
```

## Now you can run below commands from putty from windows 10 or ssh from MacOS or Linux
### Step 4: Prepare UserLand app Linux Terminal
First login into UserLand app linux terminal remotely, you should find that common linux command like "top", "uptime" does not work.
Please run below for workaround for those issues:
```
bash prepare_userland.sh
```

After completion of above, logout and re-login into UserLand linux terminal, you should be able to use "top", "uptime" etc command.


### Step 5: Install library files, wallet and cheetah_cpuminer
Please run below shell script in Userland Debian for installing dependencies and library files:
```
bash prepare_neng.sh
```
The above step automatically download binary NENG wallet file and cheetah_cpuminer in current folder.

### Step 6: Optimize CPU mining with Cheetah_Cpuminer:

Run below to find cpu info and memory information:

```
more /proc/cpuinfo
top
```
For quad core phone, 8 cpu threads were found. You can now optimize Cheetah_Cpuminer parameter to perform android mining.

For more information on CPU mining with cheetah_Cpuminer, please checkout:
https://github.com/ShorelineCrypto/cheetah_cpuminer

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
55 changes: 55 additions & 0 deletions doc/Android_Userland_App/debian/armhf/prepare_neng.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
sudo apt-get update
sudo apt-get -y install wget curl
sudo apt-get -y install build-essential
sudo apt-get -y install g++ libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils
sudo apt-get -y install libboost-all-dev

sudo apt-get -y install software-properties-common
sudo apt-get update


sudo apt-get -y install libzmq3-dev libbz2-dev zlib1g
sudo apt-get -y install libprotobuf-dev protobuf-compiler
sudo apt-get -y install openssl

sudo apt-get -y install qt4-default

sudo apt-get -y install python-pip
sudo apt-get -y install python-setuptools
sudo pip install python-bitcoinrpc

sudo apt-get -y install git
#git clone https://github.com/ShorelineCrypto/NewEnglandCoin.git
git clone https://github.com/ShorelineCrypto/cheetah_cpuminer.git


# Berkeley DB: http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
# This can not be compiled and used for NENG wallet
# we obtained binaries from Ubuntu 18.04 and bundled in one folder

wget https://github.com/ShorelineCrypto/NewEnglandCoin/releases/download/v1.4.0.5/ubuntu18_armhf_db-4.8.30.NC.tgz
tar xvfz ubuntu18_armhf_db-4.8.30.NC.tgz
sudo mv db-4.8.30.NC /opt/
sudo mv bitcoin.conf /etc/ld.so.conf.d/

wget https://github.com/ShorelineCrypto/NewEnglandCoin/releases/download/v1.4.0.5/ubuntu18_armhf_miniupnpc.tgz
tar xvfz ubuntu18_armhf_miniupnpc.tgz
sudo mv miniupnpc /opt/
sudo mv miniupnpc.conf /etc/ld.so.conf.d/

wget https://github.com/ShorelineCrypto/NewEnglandCoin/releases/download/v1.4.0.5/ubuntu16_armhf_openssl1.0.tgz
tar xvfz ubuntu16_armhf_openssl1.0.tgz
sudo mv openssl /opt/
sudo mv openssl.conf /etc/ld.so.conf.d/

wget https://github.com/ShorelineCrypto/NewEnglandCoin/releases/download/v1.4.0.5/ubuntu16_armhf_boost1.58.tgz
tar xvfz ubuntu16_armhf_boost1.58.tgz
sudo mv boost1.58 /opt/
sudo mv boost1.58.conf /etc/ld.so.conf.d/
## link all libary files
sudo ldconfig

## download the binary wallet and enjoy:
wget https://github.com/ShorelineCrypto/NewEnglandCoin/releases/download/v1.4.0.5/newenglandcoin_v1.4.0.5_ubuntu16_armhf.tgz
tar xvfz newenglandcoin_v1.4.0.5_ubuntu16_armhf.tgz

24 changes: 24 additions & 0 deletions doc/Android_Userland_App/debian/armhf/prepare_userland.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Productivity tools
sudo apt-get update
sudo apt -y install ssh
sudo apt -y install wget
sudo apt -y install screen
sudo apt -y install vim
sudo apt -y install nano

## fix proc and permission errors causing top ps to fail, workaround
## toybox-armv7l workaround provided at:
## https://github.com/CypherpunkArmory/UserLAnd/issues/87

wget http://landley.net/toybox/bin/toybox-armv7l
chmod a+rx toybox-armv7l
sudo mv toybox-armv7l /usr/local/bin/

cat >> ~/.bashrc << EOF
alias top="toybox-armv7l top"
alias ps="toybox-armv7l ps"
alias uptime="toybox-armv7l uptime"
alias reset="toybox-armv7l reset"
EOF
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,15 @@ Please run below shell script in Userland Ubuntu for installing dependencies and
```
The above step automatically download binary NENG wallet file and cheetah_cpuminer in current folder.

### Step 6: Optimize CPU mining with Cheetah_Cpuminer:
### Optional Step 6: compile boost 1.58 from source
The above should work for most of arm64 android phones/chromebook. However it may fail in rare phone/chromebook cases.

You can fix the hardware incompatible issue by removing binary boost1.58 and compile boost 1.58 library in the machine from source as replacement:
```
bash compile_boost1.58.sh
```

### Step 7: Optimize CPU mining with Cheetah_Cpuminer:

Run below to find cpu info and memory information:

Expand Down
10 changes: 10 additions & 0 deletions doc/Android_Userland_App/ubuntu/arm64/compile_boost1.58.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sudo rm -rf /opt/boost1.58

wget -O boost_1_58_0.tar.bz2 http://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.bz2/download
tar xvfj boost_1_58_0.tar.bz2
cd boost_1_58_0
./bootstrap.sh --with-libraries=all --with-toolset=gcc
./b2 toolset=gcc
sudo ./b2 install --prefix=/opt/boost1.58

sudo ldconfig
82 changes: 82 additions & 0 deletions doc/Android_Userland_App/ubuntu/armhf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Mobile Mining on Android 32 bits phone (armhf) with UserLand App

This folder describe how to CPU mine NewEnglandcoin (NENG) on 32 bits android phone (armhf).

Please read high level overview first from pdf report:
https://github.com/ShorelineCrypto/NewEnglandCoin/releases/download/NENG_2020_Q3_report/NENG_2020_Q3_report.pdf


### Step 1: Install and setup UserLand app from Google Play Store

First install free "UserLand" app from google play store. After installation, click Distribution
"Ubuntu", pick a username, password, and VNC password (which could be same password). You will enter
a linux terminal inside UserLand app, which runs armhf version of Ubuntu 18.04.

Here we are recommending running through SSH (linux terminal) only, not VNC. For linux GUI, it is much better to run remotely
through putty and you can display all linux GUI software in windows 10 with a few mouse clicks of free software download and installs. See optional
item at bottom of the parent page.

### Step 2: prepare UserLand

Type below commands in linux terminal inside Userland:

```
sudo apt update
sudo apt install wget ssh
hostname -I
```

### Step 3: Remember IP of phone from above step, remote login from desktop computer

For windows 10 desktop machine, install a free software "PuTTY", login into phone with your
username/password picked at port 2022

A screen shot of putty was provided.

For linux or MacOS, you can remote login with ssh from command line at port 2022. For example
IP = 192.168.1.4 with user "hlu" like below
```
ssh [email protected] -p 2022
```

## Now you can run below commands from putty from windows 10 or ssh from MacOS or Linux
### Step 4: Prepare UserLand app Linux Terminal
First login into UserLand app linux terminal remotely, you should find that common linux command like "top", "uptime" does not work.
Please run below for workaround for those issues:
```
bash prepare_userland.sh
```

After completion of above, logout and re-login into UserLand linux terminal, you should be able to use "top", "uptime" etc command.


### Step 5: Install library files, wallet and cheetah_cpuminer
Please run below shell script in Userland Ubuntu for installing dependencies and library files:
```
bash prepare_neng.sh
```
The above step automatically download binary NENG wallet file and cheetah_cpuminer in current folder.

### Optional Step 6: compile boost 1.58 from source
The above should work for most of armhf android phones/chromebook. However it may fail in rare phone/chromebook cases.

You can fix the hardware incompatible issue by removing binary boost1.58 and compile boost 1.58 library in the machine from source as replacement:
```
bash compile_boost1.58.sh
```

### Step 7: Optimize CPU mining with Cheetah_Cpuminer:

Run below to find cpu info and memory information:

```
more /proc/cpuinfo
top
```
For quad core phone, 8 cpu threads were found. You can now optimize Cheetah_Cpuminer parameter to perform android mining.

For more information on CPU mining with cheetah_Cpuminer, please checkout:
https://github.com/ShorelineCrypto/cheetah_cpuminer

10 changes: 10 additions & 0 deletions doc/Android_Userland_App/ubuntu/armhf/compile_boost1.58.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sudo rm -rf /opt/boost1.58

wget -O boost_1_58_0.tar.bz2 http://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.bz2/download
tar xvfj boost_1_58_0.tar.bz2
cd boost_1_58_0
./bootstrap.sh --with-libraries=all --with-toolset=gcc
./b2 toolset=gcc
sudo ./b2 install --prefix=/opt/boost1.58

sudo ldconfig
29 changes: 29 additions & 0 deletions doc/Android_Userland_App/ubuntu/armhf/prepare_neng.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
sudo apt-get update
sudo apt-get -y install ssh wget curl unzip
#install libbost, gcc and g++ compilers
sudo apt-get -y install build-essential
sudo apt-get -y install g++ libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils
sudo apt-get -y install libboost-all-dev
sudo apt-get -y install software-properties-common
sudo add-apt-repository -y ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get -y install libdb4.8-dev libdb4.8++-dev
sudo apt-get -y install libzmq3-dev libbz2-dev zlib1g libminiupnpc-dev
sudo apt-get -y install libqt4-dev libprotobuf-dev protobuf-compiler

sudo apt -y install git
sudo apt -y install python-pip
sudo pip install python-bitcoinrpc

## reuse prior compiled boost libary for Ubuntu 18.04
wget https://github.com/ShorelineCrypto/NewEnglandCoin/releases/download/v1.4.0.5/ubuntu16_armhf_boost1.58.tgz
tar xvfz ubuntu16_armhf_boost1.58.tgz
sudo mv boost1.58 /opt/
sudo mv boost1.58.conf /etc/ld.so.conf.d/
## link all libary files
sudo ldconfig

git clone https://github.com/ShorelineCrypto/cheetah_cpuminer.git
## download the binary wallet and enjoy:
wget https://github.com/ShorelineCrypto/NewEnglandCoin/releases/download/v1.4.0.5/newenglandcoin_v1.4.0.5_ubuntu16_armhf.tgz
tar xvfz newenglandcoin_v1.4.0.5_ubuntu16_armhf.tgz
24 changes: 24 additions & 0 deletions doc/Android_Userland_App/ubuntu/armhf/prepare_userland.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Productivity tools
sudo apt-get update
sudo apt -y install ssh
sudo apt -y install wget
sudo apt -y install screen
sudo apt -y install vim
sudo apt -y install nano

## fix proc and permission errors causing top ps to fail, workaround
## toybox-armv7l workaround provided at:
## https://github.com/CypherpunkArmory/UserLAnd/issues/87

wget http://landley.net/toybox/bin/toybox-armv7l
chmod a+rx toybox-armv7l
sudo mv toybox-armv7l /usr/local/bin/

cat >> ~/.bashrc << EOF
alias top="toybox-armv7l top"
alias ps="toybox-armv7l ps"
alias uptime="toybox-armv7l uptime"
alias reset="toybox-armv7l reset"
EOF
File renamed without changes.
Loading

0 comments on commit a55a939

Please sign in to comment.