robosats icon indicating copy to clipboard operation
robosats copied to clipboard

Ditch react-native-tor in favor of official Tor Android client

Open shyfire131 opened this issue 2 years ago • 2 comments

What does this PR do?

This PR lays foundations for https://github.com/RoboSats/robosats/issues/619

This PR removes the (unmaintained) dependency react-native-tor, and replaces it with the official Tor android proxy. It wraps the official Tor android proxy in a React Native Native Module and starts it as a foreground service on app boot. The TorClient class in React Native is updated to use OkHttp, which is configured to use the new Tor Proxy.

Bonus: since we're improving Tor, all instances of "TOR" have been renamed to "Tor" to align with the official spelling.

Roadmap items for future consideration

  • [ ] Use React Turbo Modules (New Architecture)
  • [ ] If a Tor proxy is already running e.g. Orbot, there is no option to configure RoboSats to use that. It will start a second proxy. I think this is mostly fine though.
  • [ ] The app needs a logging module, ideally something where logs can be exported so that users can submit diagnostic logs when they encounter issues
  • [ ] Websockets :)

Checklist before merging

  • [X] Install pre-commit and initialize it: pip install pre-commit, then pre-commit install. Pre-commit installs git hooks that automatically check the codebase. If pre-commit fails when you commit your changes, please fix the problems it points out.
  • [ ] smoke testing: Test a trade end-to-end, currently the chat has not been tested since the site is down
  • [ ] some soak testing would be good too, big change
  • [ ] Proguard is currently disabled

shyfire131 avatar Aug 23 '23 22:08 shyfire131

Hey @shyfire131 this PR is looking super exciting. Please, let me know if I can help by testing out stuff :D

Let's insta-convert this PR into a rewarded task of the same value as the original torification implemented by @KoalaSat of 2M Sats

Reckless-Satoshi avatar Aug 28 '23 10:08 Reckless-Satoshi

Hey @shyfire131 this PR is looking super exciting. Please, let me know if I can help by testing out stuff :D

Sounds good! I just want to spend a bit of time to see if I can reproduce the "connection hangs" issue which requires an app restart. Current thinking is that it's a slow device issue.

Hopefully I can reproduce it on testnet.

I know that's always been there for the APK and isn't related to this PR, so hopefully it's OK if I include that in this scope.

ghost avatar Aug 28 '23 12:08 ghost