gwasm_dispatcher_cpp
is a library that makes it easy to run an application
with
gwasm_runner.
There is also a similar library for rust: gwasm-dispatcher.
#include <gwasm.hpp>
std::vector<std::tuple<gwasm::Blob, int, gwasm::Output>>
my_splitter(int argc, char* argv[], gwasm::SplitContext& context);
std::tuple<int, gwasm::Blob>
my_executor(gwasm::Blob&& blob, int i, gwasm::Output&& output);
void
my_merger(int argc,
char* argv[],
std::vector<std::pair<std::tuple<gwasm::Blob, int, gwasm::Output>,
std::tuple<int, gwasm::Blob>>>&& results);
int main(int argc, char* argv[])
{
return gwasm::run(argc, argv, my_splitter, my_executor, my_merger);
}
See docs/more_detailed_readme.md for more details.
You can run the executable manually, according to the gwasm runner_interface, or compile to wasm and run with gwasm-runner itself.
For using the library:
- a compiler supporting C++17.
- nlohmann/json
Additionally, For running the test suite: Boost.
Use meson for building and installing.
See example_app/README.md for usage with example application.
Code style is managed by clang-format.
meson setup . build
ninja -C build test