IDENA node installation process on your Android mobile device
Your device must support ARM64 (AArch64) instructions
Preamble
In general idena node client is set to be installed on the desktop computer or VPS/VDS server. However due to the low system requirements it can be also installed on your old Android device for the future use as your personal 24/7 IDENA mining server.
The purpose of the article is to explain the installation process in details and bring more people into independent mining. As you know the majority of new members do not have coins in the stake so, they prefer to deligate themselves to pools because of the prospective financial obligations related to server hosting expenses. Considering the fact that many people have old phones that actually are on the shelf it is fair to assume that those devices potentially could be used to mine IDENA, create flips and pass validation without necessity to buy an API key and pay fees to pools.
In my case I would use my old Samsung Galaxy S6, that has the following system specifications:
Step 1. Check if your phone meets minimum system requirements.
The most important part is to be sure that the CPU of your mobile device has supported the 64-bit ARM extension called AArch64. Inware it’s a free and simple utility that shows all required information.
Mobile device list confirmed as compatible to run ARM64 idena-go node client
In case if you successfully use your mobile device as Idena node server, please send me the model of your phone to update the table.
Xiaomi devices based on MIUI
MIUI battery usage optimization is extremely high. As a result, termux application cannot being run continiously as background process. There is a strong probability that you would need to install a custom ROM. LineageOS is the best one so far for Xiaomi devices based on MIUI OS.
General scheme for idena-go implementation on ARM64 based devices
- F-Droid: Termu and Termux:boot installation
- Giving required storage permissions and adding F-Droid, Termux and Termux:boot to the power monitor application exception list
- Termux terminal preparation using termux-init.sh script to host Kali Linux
- Using Idena ARMer script to download/compile idena-go client, set all required services and import keys if necessary
Termux and termux:boot installation from the alternative app store and software repository F-Droid
Termux is an Android terminal emulator and Linux environment application that works directly with no rooting or setup required. A minimal base system is installed automatically, additional packages are available using the package manager. In our case we would need only openssh package to make possible establish SSH connection between your desktop computer and your cellphone inside your home network. It is important to note that establishing SSH connection to your mobile device outside of the home network is beyond the scope of this guide.
- Since November 2, 2020 termux updates are no longer be able to be published on Google Play Store. So, as developers said everyone should move to Termux F-Droid version, if possible.
- After installation using the search button please find and install Termux and Termux:boot applications
- Termux application initialization
After installation you must run Termux
for the first time to make app bootstrap itself and get your system ready. Please do not close the app. Press the home button on your phone and continue to the next step.
- Termux:boot application initialization
Run Termux:Boot
for the first time to make app initialization and get your system ready to run scripts at boot time.
Allow Termux to access to the file storage of your Android phone
Switch back to Termux terminal and run the following commandtermux-setup-storage
Prevent Android OS from killing Termux app to save battery life
Please remember that the above screenshots are applicable to Samsung Galaxy S6. With great probabibility the structure of the menu on your device would be slightly different and it depends on Android version and the model of your device.
Termux terminal preparation to run Kali Linux
Next step is to download a special script from IDENA ARMer repository. It will download and install all required packages and configure the password for SSH connection.
- Updating Termux packages
pkg upgrade -y
If you’ve got Failed to fetch
error, please use termux-change-repo
command to select another termux repository mirror
termux-change-repo
In case of changing repository mirror you have to repeat the upgrade command pkg upgrade -y
- Downloading termux-init.sh script to prepare your termnial to host Kali Linux
curl -O https://raw.githubusercontent.com/ltraveler/idena-armer/master/termux_init.sh
- Running the script
chmod +x ./termux_init.sh && ./termux_init.sh
- Set and remember the password for SSH connection. Anyone knowing your password and IP address can access your phone with all ensuing consequences.
- Save your IP address. Port 8022 specifies the port number for SSH connection.
IDENA ARMer script to setup your idena-go mobile node client
Now termux is ready to install Idena node to our Android mobile device. IDENA ARMer script helps to set your idena-go client and prepare your system to automatically run it after each boot. The script asks you some questions and set your phone ready to work as 24/7 Idena personal mining mobile server.
- Running Kali Linux
./start-kali.sh
- Update all installed packages to the latest version
apt update && apt upgrade -y
- Install Git package
apt install git -y
- Clonning IDENA ARMer repository
git clone https://github.com/ltraveler/idena-armer.git
- Running IDENA ARMer script
cd idena-armer && chmod +x ARMer_init.sh &&./ARMer_init.sh
IDENA ARMer: idena-go compilation, node configuration, creating separate user for idena daemon, import keys
- Set a username used to run idena-go client as a daemon task
- idena-go compilation process or downloading the compilied binary file
The script has 2 options to download the compiled binary ARM64 idena-go client or to compile the program from the source code. The compiled version appeared on the repository in about 24 hours after offical node release. It is recommended to answer N
on the compilation prompt.
- Import private and node api keys in case if you have them. The
N
answer set them to the generated default ones
Don’t forget to save the newly generated API and Private keys.
Congratulations your idena node has been successfully installed!
Reboot your phone and try to connect to it via SSH using credentials that your have saved on the above step.
IDENA Coacher — Node Management Tool
IDENA Coacher is the node monitor tool which helps to manage your node in a user friendly way. As you can see in the above screen shot it can do the most important operations without having to run IDENA Desktop client.
- It is placed in the home folder of the user that has been used to install idena:
cd /home/$username/idena-coacher
*$username
— is the name of the user that has been set to run idena-go node client
- Make script executable:
chmod +x idena_coacher.sh
- Run the script:
./idena_coacher.sh
Set port forwarding from your phone idena node to your idena-desktop client
A final word
In general mobile devices are unappropriated to be used as 24/7 server but due to the fact that the system requirements to run idena node client is low this solution gives a possibility to become an idena node validator and miner with a low budget and brings more poeple into the solo mining field to help the IDENA Network be more decentralized.
- Please use SSH connection to manipulate with the settings of your node.
- Do not close Termux terminal on your phone
Some important commands
Print private key:
cat /home/$username/idena-go/datadir/keystore/nodekey
*$username
— is the name of the user that has been set to run idena-go node client
Print API key:
cat /home/$username/idena-go/datadir/api.key
*$username
— is the name of the user that has been set to run idena-go node client
Stop idena
service idena stop
Start idena
service idena start
Rebuild idena blockchain database and start idena again
service idena restart
In case if something went wrong and you want to remove Kali Linux without Termux reinstallation
wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Uninstaller/Kali/UNI-kali.sh && bash UNI-kali.sh
Be sure, that you are running this command inside Termux shell and NOT IN Kali shell. It will fully remove Kali from Termux and you can install Kali Linux again by running:
pkg install wget openssl-tool proot -y && hash -r && wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Installer/Kali/kali.sh && bash kali.sh
and start IDENA ARMer installation process from this step
Update Idena node client (idena-go) to the latest version
/home/$username/scripts/armer_update.sh
*$username is the name that you have set to run IDENA node
idenachain.db safety system
Special script is checking idena-go log files and in case if it founds specific error message it stops idena daemon, delete idenachain.db folder and restore the blockchain from the fresh snapshot.
Why do we need that? Well, originally mobile devices are not adequate for being running as 24/7 server. There is a strong chance that in one moment your cellphone gonna lost power (battery problem,hard reboot etc.) if that happend the blockchain database could be corrupted and the only way to recover it is to restore it from the snapshot. I have added 2 basic messages that I could catch during my experience of using the script.
If you would like to add additional error messages to search please edit idena_selfcheck.sh
file from /home/$username/scripts
folder.
As you can see by default there are 2 search strings:
chain_err=(‘Cannot transform consensus config’ ‘corrupted or incomplete’)
I would appreciate if you could share additional error messages to add it for the future versions of the script.
Be free to DM me in telegram or to open an issue in the IDENA ARMer repository.
Special thanks:
Rioda — for the short hints that finally have been transformed and evolved to be represented as the final IDENA ARMer script