Crate ws_sdk

source ·
Expand description

A Rust SDK for writing Webassembly for W3bstream.

W3bstream is a general framework for connecting data generated in the physical world to the blockchain world. Webassembly is selected as the programming language for data processing.

At a high level, W3bstream provides several Application Binary Interfaces (ABIs) to enhance the Webassembly ability for developers:

  • streaming: Reading or Writing the data in the stream
  • database: Storing or accessing the data in the database
  • blockchain: Writing or reading the contract on the blockchain
  • logging: Logging information or errors

Guide level documentation is found on the website.

Examples

Say “Hello World!” to the w3bstream:

use ws_sdk::log::log_info;

#[no_mangle]
pub extern "C" fn start(_: i32) -> i32 {
    log_info("Hello World!");
    return 0;
}

Modules

  • Interact with contracts on the blockchain in the wasm.
  • Interact with database in the wasm.
  • Send a log from VM to the host.
  • Interact with the source and sink of the stream.