android-termux-monero-node
android-termux-monero-node copied to clipboard
[Feature] Tor Hidden Service
It may be fairly trivial to expose the node as a Tor hidden service (using Orbot, or other ways). These services can be created through the Orbot GUI, but there also may be a more programmatic way. Simple instructions to do this will allow users to set a phone anywhere in the world and have a node they can remote connect to. Lets find out how difficult this is, if it's even possible, and discuss best ways to integrate into install script.
Haha I didnt see this But I've already just got it done in practice, just need to get it in the script.
Spent the last couple hrs trying to get it done.
Care to let me knowhow she's working?
qstotuswqshpfq3tk5ue6ngbx6rge3macsfa7qyt5j4caopixxhckpad.onion 18089
Monerujo was finicky, and cake requires orbot. Rujo working fine now (had to disable orbot). Currently im using cake over lan and rujo over net
Also. Are there any caveats that you know of to having a tor service running? RAM usage, CPU, data usage? Dont want to waste time with prompts/ making it optional if its negligible.
I was able to connect and sync with your Tor node totally fine via Monerujo on my end. Worked great! I'm still syncing the node on my phone, so am not really able to fully test with Orbot, but I did notice that my Orbot shut down (at some point) due to low ram.
I personally like the idea of giving the best out of the box experience / sane defaults and I think a node accessible over Tor is an awesome/useful thing to have.
Only thing I can think of for not wanting it outside of maybe phone hardware limitation (as you said- ram, cpu, battery, data) is that Tor usage may be illegal in some jurisdictions.
Out of curiosity, how are you creating the service? Just through the Orbot GUI? What needs to be added to the script to make it work?
I think it would be nice if there was:
- Enable/Disable Tor Node widget scripts
- Display a 🧅 Tor Enabled in the notification
- Display the onion url in the notification / have an easy way to copy it (can be copied easily in orbot)
Hmmmm well I suppose it could all be done without Orbot at all, couldn't it... :thinking: Using the tor package would probably be much lower ram usage as well...
https://github.com/nahuhh/android-termux-monero-node/releases/tag/V4.1.3
Smashed out s version that I think works.
Its all on by default. Didnt look into any extras just her but ill take a crack at.
I was contemplating the easiest way to copy. For now it creates a tor folder inside of the monero folder, and stores them in files.
Termux has a clipboard utility, but I figured it would be annoying to have your clipboard wiped on each startup.
I used the tor package (pkg install tor) and setup a config to avoid writes and to run as a daemon.
Couldnt get it to launch from the widget using termux services (sv up tor)
When you test, select no when asked to setup storage folders. Perhaps it is being revoked during setup? (Selecting no doesnt hurt if they were previously setup)
Nice!!! I won't be able to test for a couple days, but it looks like there is a termux-clipboard-set command that could be used in conjunction with a widget and maybe a dialog that says 'copied onion url to clipboard'.
The only thing I noticed in the code is that p2p should be 18080 rather than 18089 in the Tor setup.
Nice!!! I won't be able to test for a couple days, but it looks like there is a termux-clipboard-set command that could be used in conjunction with a widget and maybe a dialog that says 'copied onion url to clipboard'.
The only thing I noticed in the code is that p2p should be 18080 rather than 18089 in the Tor setup.
Yea, I broke the install. In a couple ways ha. Rereleased it. All good now. No cherries on top as of yet, but is functional.
Im not 100% sure if termux can have more than one notification, but it may be worth while to show a notification with 2 buttons to copy them. Though, in most use cases you wouldnt need to retrieve it often.
I added some instructions to the release notes
Updates
- TOR hidden services are active. P2P and RCP
Use these 2 commands to copy your hidden service addresses to clipboard -
- RPC:
cat monero-cli/tor/hidden_service/monero-rpc/hostname | termux-clipboard-set
- P2P:
cat monero-cli/tor/hidden_service/monero-p2p/hostname | termux-clipboard-set
update 4.1.4
https://github.com/nahuhh/android-termux-monero-node/releases/tag/4.1.4-Tor-RC
Tap notification to copy onion
Im able to sync, load my wallet etc - but I assume there arent many people running p2p over tor (rpc has a lot, but not many p2p) no incoming connections and occasional "unable to send transactions, no suitable outbound connection at height xx"
Otherwise, my daily driver now. Should only connect over tor, avoiding ip leakage
Turn off orbot before running
https://github.com/nahuhh/android-termux-monero-node/releases/tag/V4.2.0-TOR
Some extra optimizations over 4.1.4. Skips downloads and storage setup. Cleans up apt
Also incl are scripts to run p2pool P2 isnt running over tor. The p2 scripts can be used with the clearnet version 4.1.2 as well
Also. Can disregard prior extra steps etc. This should "just work". Just make sure you "update" config when prompted
@CryptoGrampy @plowsof
If you guys run, and have running 24/7, mind sharing your hidden service so I can add to the config?
Monerod will only relay tx over hidden services, but will sync over exit nodes. Often synced peer lists are heavy on clearnet addresses, leaving you isolated.