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

webrtc: WASM support #4111

Closed
youngjoon-lee opened this issue Jun 26, 2023 · 7 comments
Closed

webrtc: WASM support #4111

youngjoon-lee opened this issue Jun 26, 2023 · 7 comments

Comments

@youngjoon-lee
Copy link

youngjoon-lee commented Jun 26, 2023

Description

Make WebRTC works in WASM environments.

Motivation

#3875 (comment): Discussion for the needs of WebRTC WASM
#4015: WebTransport implementation for WASM which can be a reference of this issue.

Current Implementation

The current WebRTC transport in rust-libp2p works only for standalone nodes.

Are you planning to do it yourself in a pull request?

Yes, if there is no plan by libp2p team.

@thomaseizinger
Copy link
Contributor

Yes, if there is no plan by libp2p team.

No plans currently but very grateful for a contribution!

@mxinden
Copy link
Member

mxinden commented Jun 26, 2023

Yes indeed! Very grateful.

@mxinden
Copy link
Member

mxinden commented Jul 4, 2023

Just stumbled upon rust-libp2p libp2p-wasm-ext WebRTC bindings.

https://github.com/openmina/rust-libp2p/blob/webrtc/transports/wasm-ext/src/webrtc.js

This is used in https://github.com/openmina/openmina/blob/0e0039bfdf8ae1942b029cf98740129e7847efa8/node/wasm/src/service/libp2p/mod.rs#L71-L82.

Thanks @p-shahi for surfacing this.

@binier since you have implemented the above, mind sharing some details here? Also would you be interested in upstreaming your work or help @youngjoon-lee to do so?

One small note is that we are moving away from the libp2p-wasm-ext architecture, towards individual crates using websys. See e.g #4015.

@youngjoon-lee
Copy link
Author

Awesome. Thank you. I'll take a look at the openmina's implementation and see if I can migrate it into the websys way.

@binier
Copy link

binier commented Jul 4, 2023

@mxinden It's been a while since I touched that, so I don't remember all the details, but to speak to the state of the code, I'd say it's WIP and doesn't follow any specs (if there is any for webrtc transport). It works well with go-libp2p (modified), which was the goal. I won't be continuing work on that though, instead we've decided to implement and use custom protocol just based on WebRTC.

@youngjoon-lee Let me know if you'll have any questions, I'll gladly help.

@mxinden mxinden linked a pull request Jul 28, 2023 that will close this issue
15 tasks
@mxinden
Copy link
Member

mxinden commented Jul 28, 2023

Cross-referencing #4248 here.

@thomaseizinger
Copy link
Contributor

Closing this in favor of #4248 being merged and #4389 tracking the remaining work.

@thomaseizinger thomaseizinger closed this as not planned Won't fix, can't repro, duplicate, stale Sep 17, 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

4 participants