Bash scripts for installing Bitcoin Core on Android and run a full node on a phone!
That's possible because:
You can run a full node on a laptop and have the comfort of having screen and keyboard, not to mention to have a battery backup in case of a power cut.\ You can run a full node on a Raspberry Pi or other single-boar computer and have advantages such as less space required and less electricity demand.\ With a phone you run a full node and you can get all the pros of both laptop and Raspberry Pi. In addition a phone offers ubiquity and portability!
Installation is based on the process described in this tutorial (found here), which in turn is a modified version of BitNodes.io script.
Here are some enhancements:
*It may be not recognized by Android. Please be aware Android supports exFAT/NTFS/EXT4/F2FS partitions up to version 8.1 (Oreo)
WARNING: The use of low-quality chargers/USB cables, or with specifications that differ from those indicated by the manufacturer, may damage the phone's battery.
Ensure that the phone indicates that the battery is charging when the charger is connected via the USB hub; otherwise, it is advisable to change the hub. If the battery icon does not show charging status, the recharging process may still occur, but there is a risk of damaging the battery to the point of causing it to swell!
If you are not able or do not want to root your phone you can use the original guide that works - according to what the author says - only with some Samsung models having DeX support.
Actually root is not required only in case Termux app mounts your removable/external drive under /storage
path. In that case you have write access to drive but with a limit: the only writable location on the external drive is Android/data/com.termux/files
, a private Termux directory.
If this trade-off is ok for you then you can go for original guide and waive the enhancements described above.
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 proot tar tsu mount-utils -y && wget https://raw.githubusercontent.com/smartm0use/smartino/main/install-ubuntu20.sh -O install-ubuntu20.sh && chmod +x install-ubuntu20.sh && bash install-ubuntu20.sh
datadir
to the external drive):
apt update && apt upgrade -y && apt install curl -y && curl https://raw.githubusercontent.com/smartm0use/smartino/main/install-full-node.sh | sh
If you find awkward tapping on a small screen, you may consider to get remote access to your phone following SSH Basics by Andronix or these steps:
apt update
apt install openssh-server nano
nano /etc/ssh/sshd_config
and make the following changes:
#Port 22
to Port 2222
#PermitRootLogin prohibit-password
or #PermitRootLogin yes
and change it to PermitRootLogin yes
ssh-keygen -A
and then ssh-keygen
passwd
(minimal length is 1 character)/usr/sbin/sshd
to start the SSH server (if you get Missing privilege seperation directory: /run/sshd just create that directory with mkdir /run/sshd
and run the command again)hostname -I
or ip a
or ifconfig
to know your local IP addressssh root@<PHONE_IP_ADDRESS> -p 2222
Since you are using a mobile device you may use a SIM or an eSIM with a mobile data plan. In this case port forwarding to enable incoming connections to your node could not work due mobile operator limitations. Using Tor is the solution.
stop-btc
command)apt update
apt install tor
/etc/tor/torrc
is one possibility) and uncomment/add the following lines:
ControlPort 9051
CookieAuthentication 1
CookieAuthFileGroupReadable 1
/etc/init.d/tor start
(you can check if it is running with /etc/init.d/tor status
)start-btc
command) and then run debug-btc
to take note of the Onion address that is advertised. You can check for reachability on BitNodes.io