ssvmupnpm module installs the Second State Virtual Machine (SSVM) into Node.js as a native
addon, and provides the necessary compiler tools. Follow the steps below to install Rust and the
cargoproject. Since this program is intended to be called from a host application, not to run as a stand-alone executable, we will create a
Cargo.tomlfile to add a
[lib]section. It tells the compiler where to find the source code for the library and how to generate the bytecode output. We also need to add a dependency of
wasm-bindgenhere. It is the utility
src/lib.rs. You can see that it takes two input parameters. Let's not worry about the
contextat this moment. The function parameter
scomes from the HTTP request when a user calls this function over the web.
.wasmfile is the WebAssembly bytecode program.
curlcommand to upload the
wasmfile to the FaaS service. In the beta stage, it is all FREE!
wasmfile in the FaaS system.
curlcommand to run the
say()function in the wasm program. The argument
sfor this function call is passed in as a string in the HTTP request body.
contextcomes into play.