libp2p / rust-libp2p

The Rust Implementation of the libp2p networking stack.
https://libp2p.io
MIT License
4.61k stars 961 forks source link

wasm-ext: Replace `libp2p-wasm-ext` with `libp2p-websocket-websys` #3611

Closed thomaseizinger closed 1 year ago

thomaseizinger commented 1 year ago

@vincev built a pure Rust websys-based websocket transport here: https://github.com/vincev/libp2p-websys-transport

We currently offer something similar in https://github.com/libp2p/rust-libp2p/tree/master/transports/wasm-ext but involves Javascript.

The libp2p-wasm-ext transport is a bit more capable because it allows arbitrary transports to be plugged in. In reality, you can only use websocket though. Both WebRTC and WebTransport are not possible because they have a built-in security protocol and multiplexer.

@mxinden Should we retire our libp2p-wasm-ext module in favor of one with websys bindings?

dariusc93 commented 1 year ago

Honestly, I dont see a downside to migrating over to websys since it would be less code (eg js) to maintain.

mxinden commented 1 year ago

I don't have much experience with either. Off the top of my head this sounds like the right step forward.

thomaseizinger commented 1 year ago

@vincev Would you be up for contributing your transport to the mono repo?

vincev commented 1 year ago

@thomaseizinger sure no problem, how can I help?

thomaseizinger commented 1 year ago

Really, all there is to do is deleting the existing libp2p-wasm-ext from this repository and moving your crate into the workspace! We'd also need you do add the @libp2p/rust-libp2p-maintainers teams as owners to the crate on crates.io so we can publish updates going forward.

If that works for you, it'd be great if you could send a PR!

vincev commented 1 year ago

Sounds good, I'll create a PR in the next few days.

vincev commented 1 year ago

How do I add you as owners? I tried the following but I am getting an error:

cargo owner -v --list libp2p
    Updating crates.io index
tomaka (Pierre Krieger)
mxinden (Max Inden)
github:paritytech:core-devs (Core devs)
github:paritytech:libp2p-devs (Libp2p devs)
github:libp2p:repos-rust (Repos - Rust)
github:libp2p:rust-libp2p-maintainers (rust-libp2p Maintainers)

and then when I try to add maintainers I get:

cargo owner --add github:libp2p:rust-libp2p-maintainers
    Updating crates.io index
error: failed to invite owners to crate `libp2p-websys-transport` on registry at https://crates.io

Caused by:
  the remote server responded with an error: could not find the github team libp2p/rust-libp2p-maintainers
thomaseizinger commented 1 year ago

I am not sure about the exact syntax. @mxinden Can you help?

mxinden commented 1 year ago

Not sure whether this is still an issue.

cargo owner --add github:libp2p:rust-libp2p-maintainers
    Updating crates.io index
error: failed to invite owners to crate `libp2p-websys-transport` on registry at https://crates.io

Caused by:
  the remote server responded with an error: could not find the github team libp2p/rust-libp2p-maintainers

My first guess would be that you can only add a GitHub group in case you are part of that group. Would that make sense?

vincev commented 1 year ago

My first guess would be that you can only add a GitHub group in case you are part of that group. Would that make sense?

Yes makes sense, but you are right we don't need to do this anymore as you now own libp2p-websys-websocket.