substrate-api-client
substrate-api-client copied to clipboard
Test/Example for WebAssembly
It would be nice to have an example that works with WebAssembly. We should also have some tests that run a WebAssembly executable. Some of the existing examples might actually work but it would still be nice to document this.
- Find/Write an example that works with wasm
- Run this example with a wasm runtime
- Documentation
- What does work with WebAssembly
- Differences between wasm-unknown-unknown and wasm-wasip1
- Differences no_std and wasm
Using the kitchensink_runtime
seems very problematic. As soon as it is included the wasm module cannot be instantiated anymore 👎
Error: failed to run main module `target/wasm32-unknown-unknown/release/examples/wasm_example.wasm`
Caused by:
0: failed to instantiate "target/wasm32-unknown-unknown/release/examples/wasm_example.wasm"
1: unknown import: `env::ext_trie_blake2_256_ordered_root_version_2` has not been defined
@Niederb What's your suggestion on how we should continue with this? Should we try to fix this in the kitchensink_runtime (with the goal to do a PR there?) or create an example with a different runtime? Or just pause this issue and try again in the future?
I already worked quite a bit on the test infrastructure. At least a very minimal example should be possible and I think having something running with WebAssembly would already be useful.