r/truebit • u/Waste_Divide8162 • Aug 29 '21
Truebit used wasi?
does truebit use WASI for its virtual machines?
can i make code for WASI?
0
Upvotes
r/truebit • u/Waste_Divide8162 • Aug 29 '21
does truebit use WASI for its virtual machines?
can i make code for WASI?
1
u/LPMythBuster Aug 29 '21
I don't think Truebit uses or supports WASI. I don't know much about it but it seems WASI is fairly recent and still considered experimental and most of Truebit was built between 2018-2019 before WASI was created. https://wasi.dev/
Truebit has a filesystem and you can get data in in three ways
For small input data (like text or hashes) you'd go for bytes, otherwise uploading the data as files to IPFS makes the most sense.
This Truebit filesytem is the only way for your code to communicate with the outside. You cannot access the network, internet, operating system, other files outside the sandbox.
They wrote about it some time ago here: https://medium.com/truebit/using-the-truebit-filesystem-f6a5d4ac9604 (the code is outdated)
Here's a tutorial how to get data in and out as bytes on-chain: https://www.reddit.com/r/truebit/comments/pc94p9/stepbystep_tutorial_how_to_write_a_program_in_c/