On Twitter, he showed how it is possible to help strengthen the security of the Bitcoin network and run a full node with a Samsung J9 running an Android operating system, which he bought secondhand for R$ 350 (or US$64).
The phone is tasked with running Bitcoin’s software. The device can be replaced by a tablet, computer or Raspberry Pi.
While other devices can be used in this experiment, Reis recommends Samsung devices with DeX technology, because these models can detect the external drive and keep charging the mobile phone at the same time.
É possível rodar um Full Node de Bitcoin usando Android.— Ricardo Reis (@ricardoreis007) July 13, 2022
Em um Samsung Galaxy S9 instalei o aplicativo Termux, no qual criei um ambiente Ubuntu, então rodei o Bitcoin Core e armazenei o Blockchain no HD USB de 1 TB.
Usei um Hub USB para conectar o HD enquanto carrega o S9…🧵 pic.twitter.com/zp7KddrXcD
Bitcoin nodes are computers that run Bitcoin software and are connected to the Bitcoin network. Bitcoin nodes validate, broadcast, process and store bitcoin transactions.
There are different Bitcoin nodes, such as “mining nodes” (used by miners) and “light nodes” (that run a lightweight version of the blockchain), but the example mentioned here involves a “full node”.
Besides needing a device to run the software, you will also depend on an external storage drive (such as a HD or SSD) with enough capacity to store blockchain data, besides having a USB hub type-C for charging your phone while it is connected to the drive.
As explained by Reis in his full tutorial, you must have a 1 TB HD with USB connection to run a full node.
Tutorial: Running a full Bitcoin node
With the three devices at hand, Reis describes the steps that must be followed to run a full Bitcoin node.
1. Setting up
The first step is the setup: Connect the hard drive and the charging cable on the USB hub and then connect your phone. Keep the charging cable plugged in so that the phone does not turn off during the process.
2. Formatting the hard drive
After the phone detects that the external hard drive is connected to the device, now it is the moment to format it. In the file manager, find the storage drive and format the external drive.
If the hard drive is not detected, it is possible to format it through the phone configurations: Device care > Storage > Advanced > SD Card > Format.
3. Installing Termux
You must install Termux, a Linux terminal emulator for Android. It will provide the emulation environment for Ubuntu Linux, which is necessary to install the Bitcoin Core software.
4. Installing Ubuntu on Termux
After installing Termux on the phone, you must install Ubuntu on the emulator. All you have to do is copy and paste the code below on Termux and execute it:
pkg upgrade && termux-setup-storage && curl https://raw.githubusercontent.com/AndronixApp/AndronixOrigin/master/repo-fix.sh > repo.sh && chmod +x repo.sh && bash repo.sh && pkg update -y && pkg install wget curl proot tar -y && wget https://bitbrasil.com.br/sh/ubuntu20.sh -O ubuntu20.sh && chmod +x ubuntu20.sh && bash ubuntu20.sh
5. Installing Bitcoin Core
In the same way that Ubuntu was installed on Termux, install Bitcoin Core on Ubuntu by copying and pasting the following command and executing it on Termux. This code will install the Bitcoin software on the mobile phone and store the blockchain data on the external drive.
apt-get update && apt-get upgrade -y && apt install curl -y && curl https://bitbrasil.com.br/sh/install-full-node.sh | sh
Following all the steps above, the installation will be concluded and you will be able to run a full Bitcoin node on your phone.
There are many commands to run the Bitcoin software: debug-btc (to view the Bitcoin Core log file), start-btc (to initiate Bitcoin Core), stop-btc (to stop the software), among others.
On the video below, Ricardo Reis shows the steps on how to install and run a full Bitcoin node on a mobile phone:
*Translated from Brazilian-Portuguese by Daniela Pereira do Nascimento.