Development / Build

Install build tools (rust and rustup)

Linux / Raspberry Pi / MacOS

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Rustup

rustup is an installer for the systems programming language Rust.

Windows

Please follow the instructions for Installing rustup on Windows

Install nightly toolchain

Once you have rustup up and running, please install the nightly toolchain.

rustup update nightly

Clone the repository

git clone https://github.com/reactive-graph/reactive-graph.git

Build the application

Build in development mode:

cd reactive-graph
cargo build

Build in release mode (takes longer, smaller binaries):

cd reactive-graph
cargo build --release

Cargo

Cargo is the Rust package manager. Cargo downloads your Rust package's dependencies, compiles your packages, makes distributable packages, and uploads them to crates.io, the Rust community’s package registry.

Run the application

cargo run

or:

cargo run --release

Checkout new version and rebuild

  1. Fetch the latest version from git:
    git pull
    
  2. (Optional) If you want a completely clean build
    cargo clean
    
  3. Update dependencies
    cargo update
    
  4. Build the application
    cargo build
    
  5. Repeat this for all plugins

Plugin API version must match

The application and the plugins must be compiled with the same version of the Plugin API!

Build plugins

Checkout and build the plugin

cd ..
git clone https://github.com/reactive-graph/plugin-mqtt.git
cd plugin-mqtt

Build in development mode:

cargo build

Build in release mode:

cargo build --release

Configure plugin

Edit config/plugins.toml and add a section for the plugin. The name must match the crate name of the plugin. Specify the path to the dynamically linked library. The path can be either absolute or relative to the working directory of the application.

[[plugin]]
name = "plugin-mqtt"
active = true
path = "../plugin-mqtt/target/debug/libreactive-graph_plugin_mqtt.so"

Artifact Location

Release builds are located in target/release instead of target/debug

Configure plugins

Please consult the documentation for configuring plugins

Plugin Compatibility

17:18:18.642 [ERROR] [main] Cannot load plugin path/libreactive_graph_plugin_base.so because of a compiler version mismatch: rustc 1.81.0 (expected: 1.82.0)

Rust Compiler

The plugins have to be compiled by the same rust compiler.