Announcing the Truebit WASI SDK for developers

Truebit Protocol
Truebit
Published in
2 min readNov 3, 2022

--

Truebit X WASI

WASI support for Truebit tasks is now available here.

Whereas WebAssembly is a virtual instruction set architecture, WASI is a systems interface for WebAssembly. Using WASI, developers can add a standard filesystem interface to WebAssembly execution independent from its runtime. The portable nature of WebAssembly allows developers to easily deploy WASI-based applications across MacOS, Windows, Linux, web browsers, and containers.

Truebit’s original WebAssembly compiler utilized Emscripten, a platform designed for porting C/C++ projects to web browsers. Our new WASI SDK integration updates the deprecated Emscripten stack and improves filesystem ergonomics.

Here’s an example of how to compile a Truebit task using WASI.

Compile a c++ task using WASI

wasic++ chess.cpp -fno-exceptions -o chess.wasm

Compile a c task using WASI
Step 1: wasicc -fno-execptions -c reverse_alphabet.c
Step 2: wasic++ reverse_alphabet.o -o reverse_alphabet.wasm

The complete examples are in github:
Chess
Reverse_alphabet

What’s next?

To start you can pull the Docker from Dockerhub or clone the github repo that is now public for your convenience. Additionally, the Truebit Getting Started Guide can be found on our website here.

We’re excited to see how our community leverages the new WASI SDK! As always, you can find us our Gitter and follow us on Twitter to stay up to date or DM us with any feedback or questions.

--

--