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

WASM Support #882

Open
kantorcodes opened this issue Dec 28, 2024 · 1 comment
Open

WASM Support #882

kantorcodes opened this issue Dec 28, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@kantorcodes
Copy link

kantorcodes commented Dec 28, 2024

Problem

At the moment the Rust SDK does not work with WASM, nor do protobufs. It'd be great if we could compile and utilize the SDK in a WASM environment. At a minimum, if protobufs could compile properly, that would enable us to have WASM code that generates proper transaction bytes that a JavaScript client could utilize. This unlocks a number of important use-cases.

I believe the crux of the issue is related to tonic which depends on mio. mio does not appear to compile for WASM, returning errors like these at build time

639 |         self.inner.deregister(registry)
    |                    ^^^^^^^^^^ method not found in `IoSource<UdpSocket>`
    |

Solution

  • Remove tonic as a dependency and find another alternative to build the proto files.
  • Add unit tests in a WASM environment

Alternatives

No response

@kantorcodes kantorcodes added the enhancement New feature or request label Dec 28, 2024
@kantorcodes
Copy link
Author

I created a small proof of concept to demonstrate making this work with protobufs, it does seem updating the SDK itself is a bit more complicated.

https://github.com/hashgraph/hedera-sdk-rust/pull/883/files

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

No branches or pull requests

1 participant