Mining Idena on Android

in #idena3 years ago (edited)

If you already have an Idena account and want to mine iDNA on Android follow this guide.
The current amount of rewards is on the main page of the project and is about 10$ a month at the time of writing.
Another great benefit of running your own node is that you can up- or downvote changes to the protocol by updating or not your node.
Not to mention that you don't have to rent a shared node to pass validations.

Make sure you have about 3-4 Gigabytes of storage free on your phone, it has around the same amount of RAM and you can spend about 300 gigabytes of Internet traffic each month (when you keep it on around the clock).

Get Termux from Play F-Droid store

Then write these commands in Termux, type y when asked through update,
choose the latest version for the build command (check it on github page).
It will take some time to build as well as synchronizing the node.
Please, switch to landscape (horizontal) mode to copy the shell commands, otherwise they get wrapped.

pkg update
pkg install git golang lld
git clone https://github.com/idena-network/idena-go && cd idena-go
go build -ldflags "-X main.version=0.27.4"
mv idena-go ../idena-node && cd ..
./idena-node

In another Termux session, which you can invoke by swiping from the left in Termux or by long tapping the app icon on home screen:

echo "$(cat datadir/api.key)" 

Copy and paste the output API key into https://app.idena.io node settings in your browser along with http://localhost:9009 address.
Export your encrypted private key from general settings,
decrypt it with https://devkodev.github.io/IdenaDevTools in another browser tab,
copy the decrypted version, then in Termux:

rm ~/datadir/keystore/nodekey
nano ~/datadir/keystore/nodekey

paste your decrypted key there, press CTRL+s then CTRL+x.

Stop the node in the first session by typing CTRL+c and then start it again

./idena-node

Open http://rpc.idena.io in your browser, connect to http://localhost:9009 and enter the API key from earlier. Request "Become online" call (press the button named this way in the left column) to begin mining, “Become offline” to pause it.

Alternatively you can download the My Idena app by redDwarf, connect to local node on http://localhost:9009 with your API key and just set the mining toggle on and off once the node is synchronized.

Leaving node mining overnight eats up roughly third of a new phone's battery.
If your phone becomes offline for more than one hour you get the penalty and have to announce your online status anew to the network. Don't forget to restart the node after you restart your phone.

To save battery life you have to stop your node from syncing by pressing CTRL+c in that Termux session, simply declaring your status as Offline doesn't do the trick.
As the node performs best when its connection to other nodes is not interrupted, you may want to run it on Wi-Fi only.

When there is a new version of node around stop yours and enter these already familiar commands

cd
rm -rf idena-go idena-node

pkg update
git clone https://github.com/idena-network/idena-go && cd idena-go
go build -ldflags "-X main.version=0.27.4"
mv idena-go ../idena-node && cd ..
./idena-node

updated on 31-10-2021

Sort:  

When I click send request in "Become online" or "Become offline" in http://rpc.idena.io , it says Something went wrong :(.
I also saw your post on hive and you said you did it with My Idena app.
How do you turn mining on and off on that app?

Oh, I see, I need to wait until the node is synced in the app.