Code Monkey home page Code Monkey logo

android-termux-monero-node's Introduction

Monerod-in-Termux

Run a Monero Node on Android using Termux

Monero Node Status in Android Notifications

Table of Contents

Background

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

  • Recommend leaving charger connected during initial sync, which can take a couple days.
  • Battery usage after sync completion is quite low, but not 0 due to wake-lock being applied.
  • While the node can be run on your main device, it is recommended to keep the device plugged in when running 24/7 or better, to run on a spare/old device.

Data Usage

  • Over 100 gb initial download.
  • After fully synced, and using config settings of: 1gb max up/down speeds; 32/100 out/in peers; averaging 25kb/s up/down:
    • Approx 2gb/day (dl) as of Sunday, January 02, 2022.
    • Slightly more than 4gb if P2P seeding is enabled.
  • You can check your data usage using the XMR Node Status shortcut from the widget. It will show in the terminal that pops up.

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.

TLDR / Install

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:

  1. Install the F-Droid App Store

  2. Install these Apps from F-Droid:

    (Do NOT install from Play store. If any of these are already installed from gplay, uninstall them)

  3. Set app permissions:

    Go to:

    1. Android Settings > search for ”Special Access"
    2. Select "Battery Optimization" > All Apps Then disable battery optimization for
      • Termux
      • Termux:Boot
    3. Return to "Special Access" screen
    4. Select "Draw over other apps" Enable draw over apps aka draw on top for:
      • Termux
  4. 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)" 
  1. Follow the prompts.

    All Users:

    Press Y when/if asked to use package maintainers version of sources.list

  2. Add the 2x2 Termux widget to your home screen.

  3. SUCCESS

NOTE: YOU WILL NOT BE ABLE TO TRANSACT UNTIL YOUR NODE IS 100% SYNCED.

Extras

  1. Run on Boot: Open the "Termux:Boot" app (once).
  2. Run in Fore/Background: "Stop" then "Start" the node from widget.
  3. Connect to your Node: Wallet Connections.
  4. Enable P2P seeding (distributing) of the Blockchain Forwarding P2P (seeding) port.

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/

WARNINGS...

  1. 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.

  2. Monero is mostly writes and reads - not rewrites - which are what kill storage the fastest.

  3. 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.

  4. Do NOT forward port 18081 (the UNRESTRICTED RPC port)

Controls Overview

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.

Connecting to your Node / Seeding the Network

Following are a few ip addresses and ports to make note of.

Wallet Connections

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

P2P Seeding

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".

Updates

  • (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.

TODO's:

  • TBD

Donate:

If you enjoy this software, please feel free to send a tip to:

85HmFCiEvjg7eysKExQyqh5WgAbExUw6gF8osaE2pFrvUhQdf1HdD6XSTgAr4ECYMre6HjWutPJSdJftQcYEz3m2PYYTE6Y
86aSNJwDYC2AshDDvbGgtQ17RWspmKNwNXAqdFiFF2Db91v9PC26uDxffD9ZYfcMjvJpuKJepsQtELAdmXVk85E1DsuL6rG
8343hzpypz2BR5ybAMNvvhaLtbXSMgCT7KqYSTfLBk3DF8Yayi5b7JGRWZc2GdqNu1EkALEFv1FHkCgeQ1zzkUFVMqtcTBy

android-termux-monero-node's People

Contributors

cryptogrampy avatar nahuhh avatar plowsof avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.