edjx function build

Builds the sample function after using the function init command.

You must be in the function directory to execute this command, that is, the directory that contains the edjconfig.yaml file.

Usage

edjx function build
[    --target-dir <string>]

Options

Option Required Type Description

--target-dir <string>

No

string

Directory to store all generated artifacts.
Default directory: target.

Global Flags

Option Required Type Description

-h, --help

No

Displays inline help for the command.

--config <file-location>

No

string

Location of client configuration file (default file path is $HOME/.edjx/.edjx.yaml).

Build a Rust function

  1. Set the organization to be associated with all EDJX operations.

    edjx config organization -i

    If no organizations display, create one using the Console.

  2. Create an application.

    edjx application create -n <string>
  3. Set the application to be associated with any new functions.

    edjx config application -i
  4. Create a function within the application.
    If you already have the function code, skip to step 4b.

    1. Create the directory and set the function parameters.

      edjx function init <string>
      Function Name: project00
      ✔ WASM
      ✔ Rust
      ✔ HTTP
      ✔ 30
      ✔ 64
      Setting up project with starter files......
      Project successfully initialized in project directory
    2. Change to the function directory.

      cd <function-directory>
    3. Open VS Code.

      code .

      VS Code displays the directory and files of your function.

      function build vscode

    4. Modify the code as desired.

  5. Execute the build command to build the function based on the .wasm file you created.

    edjx function build

    The default build location is /home/<username>/<function-name>/target/wasm32-unknown-unknown/release/<newwasmfile>.wasm.

Build a C++ function

  1. Set the organization ID associated with all EDJX operations.

    edjx config organization -i

    If no organizations display, create one using the Console.

  2. Create an application.

    edjx application create -n <string>
  3. Set the application ID to be associated with any new functions.

    edjx config application -i
  4. Create a function within the application.
    If you already have the function code, skip to step 4b.

    1. Create the directory and set the function parameters.

      edjx function init <string>
      Function Name: project01
      ✔ WASM
      ✔ C++
      ✔ HTTP
      ✔ 30
      ✔ 64
      Setting up project with starter files......
      Project successfully initialized in project directory
    2. Change to the function directory.

      cd <function-directory>
    3. Open VS Code.

      code .

      VS Code displays the directory and files of your function.

      function build vscode cpp

    4. Modify the code as desired.

  5. Execute the build command to build the function based on the .wasm file you created.

    edjx function build

    The default build location is /home/<username>/<function-name>/bin/<newwasmfile>.wasm.