Skip to content

kmd-fl/ls-effector

Repository files navigation

Fluence Effector Template

This repository provides an example of a basic effector project and serves as a template for easy effector development.

ls effector

In this project, we provide an effector for the /bin/ls binary from coreuitls.

Project Structure

This project consists of 4 crates:

  • effector is the effector module itself. To obtain the correct WASM module, it must be be built with marine build --release ;
  • cid is a rust crate for exporting the CID of the effector module. This crate is optional and only provides means to embed CIDs of selected effectors into your rust project, for example, Nox;
  • types is a rust crate with the type definitions used in the API functions of the effector module (the one with the #[marine] tag). This crate helps to interact with the effector module's API in non-effector modules. However, this crate isn't supposed to be used on its own outside of the effector crate scope; it's re-exported by the imports crate below;
  • imports is a rust crate providing the type definitions (via the types crate) as well as effector module's import definition. This crate is aimed to help import the effector modules without copy-pasting the definitions manually.

How to build

To build the project, you need:

  • Cargo to build the rust project
  • Marine CLI to build the effector module
  • IPFS CLI to build the cid crate You also may need to install Marine Repl if you want to run your module manually for testing/debugging.

The build.sh bash script located in the repository's root contains the commands to build the effector module and the cid crate. The test.sh bash script located in the repository's root contains the commands to run tests in the effector module.