status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.92k stars 984 forks source link

WIP: Status backend intergation #21517

Closed ulisesmac closed 3 weeks ago

ulisesmac commented 4 weeks ago

This PR is to show the current progress on the status-backend integration.

Setup

If you are willing to run this PR, these are the steps needed:

  1. Run status-backend at
  2. Run an Android emulator or physical device and reverse the : adb reverse tcp:<PORT> tcp:<PORT> This is needed to communicate the app with the back-end running on your computer
  3. In Status mobile, go to the ns status-backend.config and define data-dir-path with your own.
  4. Run the app as always.

If the app is stuck in a black screen, it means we have no connection with status-backend. Sometimes it crashes while creating a profile, sometimes after those steps. This still is a WIP:

https://github.com/user-attachments/assets/d6645e65-dff2-4763-ba98-7c8ae8cd5e44

Implementation details

Please refer to the ns status-backend.core for the main implementation and some REPL commands to play with.

Strategy to follow

In order to completely integrate status-backend, we need to port some native modules, see the discussion here.

So this PR is presenting an initial progress that consist of:

status-im-auto commented 4 weeks ago

Jenkins Builds

Click to see older builds (6) | :grey_question: | Commit | :hash: | Finished (UTC) | Duration | Platform | Result | |-|-|-|-|-|-|-| | :x: | 29678bc5 | [#1](https://ci.status.im/job/status-mobile/job/prs/job/tests/job/PR-21517/1/) | 2024-10-28 19:31:12 | ~2 min | `tests` | [:page_facing_up:`log`](https://ci.status.im/job/status-mobile/job/prs/job/tests/job/PR-21517/1/consoleText) | | | | | | | | | | :x: | e9b8118c | [#2](https://ci.status.im/job/status-mobile/job/prs/job/tests/job/PR-21517/2/) | 2024-10-28 19:37:57 | ~2 min | `tests` | [:page_facing_up:`log`](https://ci.status.im/job/status-mobile/job/prs/job/tests/job/PR-21517/2/consoleText) | | :heavy_check_mark: | e9b8118c | [#2](https://ci.status.im/job/status-mobile/job/prs/job/android-e2e/job/PR-21517/2/) | 2024-10-28 19:42:10 | ~6 min | `android-e2e` | [:robot:`apk`](https://status-im-mobile-prs.ams3.cdn.digitaloceanspaces.com/StatusIm-Mobile-241028-193517-e9b811-pr21517-x86_64.apk) [:calling:](https://chart.apis.google.com/chart?cht=qr&chs=400x400&chld=L%7C%0A1&chl=https%3A%2F%2Fstatus-im-mobile-prs.ams3.cdn.digitaloceanspaces.com%2FStatusIm-Mobile-241028-193517-e9b811-pr21517-x86_64.apk)| | :heavy_check_mark: | e9b8118c | [#2](https://ci.status.im/job/status-mobile/job/prs/job/android/job/PR-21517/2/) | 2024-10-28 19:43:46 | ~8 min | `android` | [:robot:`apk`](https://status-im-mobile-prs.ams3.cdn.digitaloceanspaces.com/StatusIm-Mobile-241028-193520-e9b811-pr21517-arm64-v8a.apk) [:calling:](https://chart.apis.google.com/chart?cht=qr&chs=400x400&chld=L%7C%0A1&chl=https%3A%2F%2Fstatus-im-mobile-prs.ams3.cdn.digitaloceanspaces.com%2FStatusIm-Mobile-241028-193520-e9b811-pr21517-arm64-v8a.apk)| | :heavy_check_mark: | e9b8118c | [#2](https://ci.status.im/job/status-mobile/job/prs/job/ios/job/PR-21517/2/) | 2024-10-28 19:45:27 | ~10 min | `ios` | [:iphone:`ipa`](https://i.diawi.com/svzaDf) [:calling:](https://chart.apis.google.com/chart?cht=qr&chs=400x400&chld=L%7C%0A1&chl=https%3A%2F%2Fi.diawi.com%2FsvzaDf)| | | | | | | | | | :x: | 7c09b94d | [#3](https://ci.status.im/job/status-mobile/job/prs/job/tests/job/PR-21517/3/) | 2024-10-30 03:20:36 | ~5 min | `tests` | [:page_facing_up:`log`](https://ci.status.im/job/status-mobile/job/prs/job/tests/job/PR-21517/3/consoleText) |
:grey_question: Commit :hash: Finished (UTC) Duration Platform Result
:heavy_check_mark: 3fda24b4 #4 2024-10-30 03:28:17 ~5 min tests :page_facing_up:log
:heavy_check_mark: 3fda24b4 #4 2024-10-30 03:30:17 ~7 min android :robot:apk :calling:
:heavy_check_mark: 3fda24b4 #4 2024-10-30 03:32:44 ~9 min ios :iphone:ipa :calling:
:heavy_check_mark: 3fda24b4 #4 2024-10-30 03:35:37 ~12 min android-e2e :robot:apk :calling:
:heavy_check_mark: 276eea2a #5 2024-11-01 14:55:21 ~4 min tests :page_facing_up:log
:heavy_check_mark: 276eea2a #5 2024-11-01 14:58:39 ~7 min android-e2e :robot:apk :calling:
:heavy_check_mark: 276eea2a #5 2024-11-01 14:59:25 ~8 min android :robot:apk :calling:
:heavy_check_mark: 276eea2a #5 2024-11-01 15:00:53 ~10 min ios :iphone:ipa :calling:
ulisesmac commented 3 weeks ago

@qfrank

I saw there're many other methods like create-account-and-login / init-status-go-logging are not using status-backend server yet, but you will update it later right? Because this is just a solution demo draft?

Oh, these methods are already using the status-backend :thinking: the substitution is probably unclear since I wanted to have a low impact in the codebase. We call the status backend when we execute a method from a native module.

Feel free to ping me on Discord if you have more questions.

ulisesmac commented 3 weeks ago

@ilmotta Pushed new code adding the shadow-cljs config stuff.

If the env var is marked (or the goog-define is set) as true the status backend runs. Ofc, it lacks of the proper migration for all the endpoints, we cannot complete the onboarding yet, but I think the code is good enough to be merged.

The only one point that I didn't addresss (since it still has an open discussion) is about the callback added in a promise flow.

ulisesmac commented 3 weeks ago

We changed the approach to a native implementation