Create a .wasm File Written in Rust

To create .wasm files written in Rust you must have the EDJX Rust SDK installed on your environment.

To install the required SDK:

  1. Download the latest version of Rust.

  2. Install the Rust WASM target.

    rustup target add wasm32-unknown-unknown
  3. Clone the EDJX Rust Example code repo repository from GitHub to your environment.
    This repository contains samples to help you build Rust serverless functions. The functions can then be built and deployed to the EDJX peer-to-peer network using the EDJX Console, CLI, or VS Code Extension.

See the files in the EDJX GitHub repository from advanced installation options.

To create, build, and deploy EDJX functions written in Rust:

  1. Create a function:

  2. Build the function:

    • Console - Create Function

    • CLI - function build command

    • VS Code - Build a Function
      See also Add a Function and Deploy a Function.
      By default, the .wasm file is built and saved under the host/<username>/<function-name>/target/wasm32-unknown-unknown/release directory with the following file structure.
      Project Directory Name

      |-- src
      |-- Cargo.lock
      |-- Cargo.toml
      |-- edjconfig.yaml
      |-- LICENSE
  3. Deploy the function: