Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Libp2p mobile client #162

Open
farhoud opened this issue Apr 26, 2022 · 6 comments
Open

Libp2p mobile client #162

farhoud opened this issue Apr 26, 2022 · 6 comments
Assignees

Comments

@farhoud
Copy link
Contributor

farhoud commented Apr 26, 2022

Our mobile client rn-fula it not ideal for production it has some deficiencies:

  • It's run in headless browser which is another point of failure.
  • It is hard to develop and debug! (passing error and log between react-native <---> webview <---> libp2p is possible only by sending message's)
  • DEX is awful.
  • WebView does not have access to disk so we have to read the file and pass it as stream of base64 to webview! (expo-media-lib will load/save file from/to disk <---> fula-client encode result to base64/binary <---> fula-bridge encode result to binary/base64 <---> fula-client stream data )
  • Background job is now impossible because of the webview provider --> need to write our own webview for ios and android.
  • graph subscription make it more complicated than already is.

I'm looking into alternative:

  • run js-libp2p in react
    • failed, and if it work still to hacky for production.
  • bind go-libp2p with gomobile in react natite
@farhoud farhoud changed the title go-libp2p and gomobile Libp2p mobile client Apr 26, 2022
@farhoud
Copy link
Contributor Author

farhoud commented Apr 26, 2022

I will try to bind
https://github.com/libp2p/go-libp2p/tree/master/examples/echo
in react-native sample and report my result

@farhoud farhoud linked a pull request Apr 27, 2022 that will close this issue
@farhoud farhoud removed a link to a pull request Apr 27, 2022
@farhoud
Copy link
Contributor Author

farhoud commented Apr 28, 2022

@gitaaron @keyvan-m-sadeghi @ehsan6sha @masih
These are my facts for migrating to go-libp2p I know it add complexity of writing go protocols for client, but i think that is better than develop and maintain:

  • headless WebView without provider for background service (android and ios)
  • write and maintain a protocol for bridge between webview and fula-client with all problem i mention in this

@farhoud
Copy link
Contributor Author

farhoud commented Apr 28, 2022

I don't add any think around the performance because i don't have data. but a native code most have better performance than running a browser and then run js-libp2p on it.

@gitaaron
Copy link
Contributor

Nice writeup @farhoud - as you mentioned - my main concern is having to marshal the data to a string to pass it back and forth between the webview <-> native.

@gitaaron
Copy link
Contributor

As discussed in yesterday's meeting here are a list of pros/cons for going with webview / webrtc :
- pros - not have to maintain two versions of client protocol
- cons
- inefficient (both webrtc + webview)
- complexity of webview setup
- webrtc + crypto deps
- still needs interface to react native

@ehsan6sha
Copy link
Member

I think here efficiency is priority 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants