Tutorial: Solo mining on Android phone with Public-Pool on Umbrel

I know what you’re thinking: “Solo mining with an Android phone? Has he lost his mind?” But don’t worry, I’m still sane! :smile: In a world full of high-end mining rigs that cost more than my car, I thought: Why not try the basics and see what my little phone can do?

In this tutorial I will show you how to turn your Android device into a mini mining rig that doesn’t invent a new block, but is all the more fun. Unpack your chargers, it’s going to be exciting! :iphone: :electric_plug:

  1. Install the Public-Pool app from the Umbrel App Store
  2. download termux from f-droid (Termux | F-Droid - Free and Open Source Android App Repository) and install it on your Android phone
  3. open termux and enter the following commands:
  4. termux-setup-storage
  5. apt-get update
  6. apt-get upgrade -y
  7. apt-get install wget -y
  8. apt-get install openssl-tool -y
  9. apt-get install proot -y
  10. wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Installer/Ubuntu/ubuntu.sh && bash ubuntu.sh
  11. ./start-ubuntu.sh ; su
  12. apt-get update
  13. apt-get upgrade -y
  14. apt install git -y
  15. apt install proot -y
  16. apt-get install automake autoconf pkg-config libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev zlib1g-dev make g++
  17. git clone https://github.com/tpruvot/cpuminer-multi
  18. cd cpuminer-multi
  19. ./build-linux-arm.sh
  20. ./cpuminer -o stratum+tcp://umbrel.local:2018 -u bitcoin_address.workername -p x -a sha256d -R 10
    Or with thread limitation ( -t 2 ) how many threads (depending on how many CPUs you have on your device)
    ./cpuminer -o stratum+tcp://umbrel.local:2018 -u bitcoin_address.workername -p x -a sha256d -R 10 -t 2
  21. monitor your miner on http://umbrel.local:2019

App can run in background, if you want to quit press CTRL + C.

And there you have it! :zap: :tada:
Your Android phone is now officially a mini-miner - albeit in a more symbolic sense. Of course, solo mining on a smartphone is not a way to get rich (or earn anything worth mentioning), but hey, it’s all about having fun, right? :stuck_out_tongue_closed_eyes:

If your phone started to glow a little during the process - don’t worry, that’s part of the “mining charm”! :fire: And if you’re now keen to do some “real” mining, it might be time to invest in some more powerful hardware.

Note: If no connection to Umbrel can be established, the following line should be added to /etc/hosts: 192.168.x.x umbrel.local
Replace “192.168.x.x” with your local IP of your node.

Good luck and happy mining! :hammer_and_pick:

2 Likes

Hey, me again :sweat_smile:, if my node isn’t 100% synced yet could it cause problems during setup?

It is essential that you have synchronized your node.

Hi, I followed the tutorial until the end but when I launch the last command it gives me this message “Stratum connection failed: Could not resolve host: umbrel.local”. How can I solve it?

Have you already added the following line to your /etc/hosts file?

192.168.x.x umbrel.local

Make sure to replace “192.168.x.x” with the local IP of your node.

No not yet, but I don’t understand where I should go to add it, on the phone or elsewhere?

I added the line but it still gives me this error “Stratum authentication failed” without the umbrel.local host issue.

Did you change the hosts file under Ubuntu on your phone? That should work.

Yes I did, but it keeps giving me this message “Stratum authentication failed”, I think I solved the host problem, maybe it’s something else causing the problem.

Does the phone mine enough to pay for it’s battery charge? :joy:

libgmp-dev not available

Any update?

I just reinstalled everything again to test the configuration. Everything works great. I’m 99% sure that you didn’t adjust your hosts file correctly. Assuming you have followed these instructions, here are the exact steps again on how to do this on your smartphone (Ubuntu instance):

  1. Open Termux (Note: it must be the F-Droid version)
  2. Type: ./start-ubuntu.sh ; su
  3. Type: cd ..
  4. Type: cd etc
  5. Type: nano hosts
  6. Now you can store the IP of your node here (see screenshot)
  7. Save with CTRL O and exit with CTRL X
  8. Start the CPU miner according to the instructions.

That should fix your problem. :slight_smile:

Here are the relevant screenshots:

I’m keeping my fingers crossed for you that you can do it! :hugs:

2 Likes

Have you updated the package manager?

The package should actually be installed as well (point 16 in the instructions)…

1 Like

Yeah, it’s like having a hamster power a Tesla—great for exercise, but don’t expect a road trip… :stuck_out_tongue_closed_eyes:

No it still doesn’t work, I’ll leave you the photos maybe you’ll understand something more.

Please use a BTC address that starts with “bc1” instead of a zpub. A zpub is not the right choice for transactions, as it is used for generating new receiving addresses in a HD wallet. These addresses are not suitable for direct use in transactions…

1 Like

I didn’t know that now I’m changing it, should this solve the stratum problem?

It worked, thanks! :partying_face:

1 Like

We finally did it! :muscle: Good luck mining! :slight_smile:

2 Likes