Run a Monero Node on Android using Termux
The goal of this project is to give newbs a stupid-easy way to run an energy-efficient, full or pruned Monero node on Android.
Ideally, this is an older device that's currently sitting in a drawer, doing nothing.
Why not set it up as a Monero node?
Battery Life
Data Usage
Running a Monero node allows you to connect your wallet (Feather, CakeWallet, Monerujo etc) to your node.
While Monero is private, using a remote node (one operated by a 3rd party) involves some level of trust.
A remote node receives certain information from you, such as the date, time of a tx and the IP that sent it to the node.
Running a node on Android is an easy and more decentralized way to both use and improve Monero and the Monero network.
Prerequisites:
- Android 7.0+ with ARMv8/v7 architecture
- The script will check the architecture before running
- 50GB min free space (64GB+ Recommended) for Pruned node
- 150GB min free space (256GB+ Preferred) for Full Node
- External Storage is recommended.
Steps:
Install the F-Droid App Store
Install these Apps from F-Droid:
(Do NOT install from Play store. If any of these are already installed from gplay, uninstall them)
Set app permissions:
Go to:
In termux, issue the command
sh -c "$(curl -fsSL https://github.com/CryptoGrampy/android-termux-monero-node/raw/main/src/install-monerod-in-termux.sh)"
Follow the prompts.
All Users:
Press Y when/if asked to use package maintainers version of sources.list
Add the 2x2 Termux widget to your home screen.
SUCCESS
NOTE: YOU WILL NOT BE ABLE TO TRANSACT UNTIL YOUR NODE IS 100% SYNCED.
Extras
More info on running a Monero Node:
https://www.reddit.com/r/Monero/comments/kkr04n/infographic_running_a_node_which_ports_should_i/ https://www.reddit.com/r/Monero/comments/kkgly6/message_to_all_monero_users_we_need_more_public/ https://www.reddit.com/r/Monero/comments/ko0xd1/i_put_together_a_new_guide_for_running_a_monero/
Ideally you should store the blockchain on external storage (MicroSD etc). Regardless of whether the blockchain is stored on SD or Internal.. You should run this AT YOUR OWN RISK and READ THE CODE. Feel free to make or suggest improvements.
Monero is mostly writes and reads - not rewrites - which are what kill storage the fastest.
You may risk your data or the lifespan of your microSD / Internal storage may be shortened.
It is recommended to backup before running, and preferably to run on a dedicated / spare / old device.
Do NOT forward port 18081 (the UNRESTRICTED RPC port)
Using the Termux Widget, you can: 'Start XMR Node' (foreground or background), 'Stop XMR Node', 'Update XMR Node', and check the 'XMR Node Status'.
From the notification, you can: Shutdown the node, release/acquire wakelock and refresh the notification.
The notification will be automatically be updated every 15 minutes.
Following are a few ip addresses and ports to make note of.
NOTE: YOU WILL NOT BE ABLE TO TRANSACT UNTIL YOUR NODE IS 100% SYNCED.
Wallet relationship to node: | IP: | Port: (Why?) | Forward? |
---|---|---|---|
The same device | 127.0.0.1 | 18081 (Unrestricted RPC Port) | Yes |
Different devices on the same local network | Check Notification | 18089 (Restricted RPC Port) | No |
Different devices on seperate networks | Public / Internet facing IP. Search DuckDuckGo for ”my ip" | 18089 (Restricted RPC Port) | Yes |
These are the default ports set in the config file. You can edit the config file (located at crypto/monero-cli). Here is a nice Monerod reference guide
If you want to seed (help distribute) the Monero network (Recommended) | Port: (Why?) | Forward? |
---|---|---|
18080 (P2P Port) | Yes |
The process for port forwarding may vary slightly depending on the router used. If you DuckDuckGo "port forwarding" and add the name / brand of your router, you should find a guide.
Example:
If you decide, for whatever reason, that you want to stop seeding the network, simply stop forwarding port 18080 in your router/remove the port forwarding rule.
Troubleshooting:
If P2P stops working for you, it's possible your router changed the IP of your Android device (this is normal behavior for a router).
You will likely need to set up your Android device to use a 'static ip'... For this..
Open Android Setting, and go to: wifi > tap & hold on current network > edit/modify > [show advanced] > ip settings
Change DHCP from "auto/dynamic" to "manual/static".
(Stable) CryptoGrampy/main Install script: Run
sh -c "$(curl -fsSL https://github.com/CryptoGrampy/android-termux-monero-node/raw/main/src/install-monerod-in-termux.sh)"
and follow the prompts.
Updates to Monerod (node SW): Run the 'Update XMR Node' shortcut to install the new version.
If you enjoy this software, please feel free to send a tip to:
CryptoGrampy! $XMR:
85HmFCiEvjg7eysKExQyqh5WgAbExUw6gF8osaE2pFrvUhQdf1HdD6XSTgAr4ECYMre6HjWutPJSdJftQcYEz3m2PYYTE6Y