1

Has anyone been able to build solana-client for a wasm32-unknown-unknown target (wasm-pack build --target web)?

Getting the following error building gethostname dependency

error[E0425]: cannot find function `gethostname_impl` in this scope
  --> /Users/josep/.cargo/registry/src/github.com-1ecc6299db9ec823/gethostname-0.2.3/src/lib.rs:58:5
   |
58 |     gethostname_impl()
   |     ^^^^^^^^^^^^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0425`.
error: could not compile `gethostname` due to previous error
warning: build failed, waiting for other jobs to finish...
1
  • Did you get this working? Any links to source examples? Has anyone tried that Solana-wasm-client crate?
    – David L
    Commented Jan 19, 2023 at 6:45

2 Answers 2

1

You might want to use solana-client-wasm crate. Source.

0

Solana Playground has an implementation of solana-client in WASM. I think it's a pretty comprehensive re-implementation though. You can see the full source code here: https://github.com/solana-playground/solana-playground/tree/master/wasm/solana-client

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.