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

Fix DNS resolver problem And access to interface list #51

Closed
farhoud opened this issue Jan 7, 2023 · 8 comments
Closed

Fix DNS resolver problem And access to interface list #51

farhoud opened this issue Jan 7, 2023 · 8 comments

Comments

@farhoud
Copy link
Contributor

farhoud commented Jan 7, 2023

Hi guy's
I have fixed these issues on the react-native project hoodchat
If you want i can create PR

@ehsan6sha
Copy link
Member

Can you please elaborate on the issue?

@farhoud
Copy link
Contributor Author

farhoud commented Jan 7, 2023

There is 2 major issue with Libp2p on android:

@ehsan6sha
Copy link
Member

ehsan6sha commented Jan 9, 2023

For this problem I am a bit unclear on what the issue is?
We have a working DNS on react-native that resolves fx.land relay server to enable the app connect to any blox backend. Can you elaborate on the problem?
Here is the current relay that RN can use without issue: /dns/relay.dev.fx.land/tcp/4001/p2p/12D3KooWDRrBaAfPwsGJivBoUw5fE7ZpDiyfUjqgiURq2DEcL835/p2p-circuit/p2p/[Blox perId]

we are not calling InterfaceAddrs anywhere
Maybe a good idea to write the steps needed to break the app, so that we can see what is the exact breaking point

@farhoud farhoud closed this as completed Jan 10, 2023
@ehsan6sha
Copy link
Member

hi @farhoud how did you resolve this?

@ehsan6sha ehsan6sha reopened this May 20, 2023
@ehsan6sha
Copy link
Member

@farhoud This line here causes the issue you mentioned (and another line in flush)
https://github.com/functionland/go-fula/blob/32cf82417a72ea382405d953da62f31f4e2f118d/mobile/client.go#L62

@ehsan6sha
Copy link
Member

DESCRIPTION:
The error is populated on this line of go when we compiled it for Android and imported in JAVA:
https://github.com/functionland/go-fula/blob/32cf82417a72ea382405d953da62f31f4e2f118d/mobile/client.go#L62

route ip+net: netlinkrib: permission denied
seems that error: route ip+net: netlinkrib: permission denied
is a real thing and not gone yet. It affects anything that requires discovery in the network like mdns. probabely in the features you added it is used as well
since hte issue is not closed I suspect it is still a thing: golang/go#40569 (comment)

seems they kinda solved it in ipfs shipyad, but could not fully understand how to implement in ours as well:
https://github.com/search?q=repo%3Aipfs-shipyard%2Fgomobile-ipfs%20MDNSLockerDriver%20&type=code
seems this part on Android is doing the action and htey passed it to go:
WifiManager wifi = (WifiManager) this.reactContext.getSystemService(Context.WIFI_SERVICE);
WifiManager.MulticastLock multicastLock = wifi.createMulticastLock("multicastLock");
multicastLock.setReferenceCounted(true);
multicastLock.acquire();

also I am not sure if anywhere we need this one? golang/go#40569 (comment)

@ehsan6sha
Copy link
Member

@hhio618

@farhoud
Copy link
Contributor Author

farhoud commented May 21, 2023

First you should patch the underlining packages:
w3-voice/go-multiaddr@224cf7d

create a net driver interface the same as go network driver interface

https://github.com/w3-voice/app/blob/main/go/driver_net.go

And implement the interface in java then

https://github.com/w3-voice/app/blob/main/android/core/src/main/java/fx/android/core/NetDriver.java

And then override the java driver with go driver:
https://github.com/w3-voice/app/blob/f6a901464797c98e31b66fd75292086240d39227/android/core/src/main/java/fx/android/core/CoreService.java#L131

ehsan6sha added a commit to functionland/fula-build-aar that referenced this issue May 21, 2023
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

2 participants