hedera-sdk-rust icon indicating copy to clipboard operation
hedera-sdk-rust copied to clipboard

WASM Support

Open kantorcodes opened this issue 1 year ago • 6 comments

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 avatar Dec 28 '24 20:12 kantorcodes

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

kantorcodes avatar Jan 02 '25 14:01 kantorcodes

Hi @gsstoykov I wanted to circle back and understand the timeline for this issue

kantorcodes avatar Jun 05 '25 19:06 kantorcodes

@kantorcodes I also started looking into this recently and am currently following up on the work that has been done until this point.

gsstoykov avatar Jun 09 '25 06:06 gsstoykov

bump!

kantorcodes avatar Sep 13 '25 12:09 kantorcodes

@kantorcodes Sorry for the delay here we had a Questing sprint with high priority. We will be adding this as P1 for the next sprint which starts tomorrow.

gsstoykov avatar Sep 15 '25 08:09 gsstoykov

8 for initial web assembly parsing.

gsstoykov avatar Sep 17 '25 15:09 gsstoykov