You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Status update:-
Currently the source/agora/node/WasmEngine.d unit tests run locally on either Ubuntu or MacOs.
In ci the build fails for MacOs so the install of wasmer needs to be fixed.
I managed to fix the linux build in Github workflow by using the bash installer. However currently one of the network unit tests fail.
For running wasmer in Alpine linux there is a challenge to get wasmer installed and working as the normal bash installer does not work. Wasmer should support linux musl so it is just a matter of finding a way to install it.
We worked a bit on that issue, and managed to get a function that accessed the Ledger called from WAT (WebAssembly Text) 💥
Key findings:
Binding is done outside of WebAssembly, essentially module_.instantiate(array_of_functions_that_matches_exports);
import "module" "function" => module is provided when using Function.asExtern;
We couldn't use the Function ctor that takes a delegate, had to provide the function type explicitly;
There's two types of functions, one with "environment" (context) and one without: Another way to provide context is also to use the global scope of the module (we did that with log for example);
Rough list of steps to take:
Get a simple, self contained WASM example to compile and run;
Pass arguments to and get values from a WASM function;
Have a WASM function call a D function and return blockchain data;
Define list of primitives we want to expose;
Define types we want to expose;
Get a sample C / C++ / JS code to compile to WASM and use it in Agora;
To get started we need a working proof of concept WebAssembly engine integrated into Agora.
The text was updated successfully, but these errors were encountered: