Skip to content

Links17/edgelink

Repository files navigation

EdgeLink: A Node-RED Compatible Run-time Engine in Rust

GitHub Actions Releases

Node-RED Rust Backend

English | 简体中文

Overview

EdgeLink is a Node-RED compatible run-time engine implemented in Rust.

This program is designed to execute flows.json file that have been designed and exported/deployed using Node-RED, without any editor or other HTML/Web-related functionalities. The purpose of its development is to deploy tested Node-RED flows to devices with limited memory for execution.

Only the "function" node will use the lightweight QuickJS JS interpreter to run their code; all other functionalities are implemented in native Rust code.

Features

Memory Usage

  • High Performance: Leverage the advantages of the Rust language for excellent performance.
  • Low Memory Footprint: Reduce memory usage compared to the NodeJS backend. Tests indicate that, for running a same simple workflow, the physical memory usage of EdgeLink is only 10% of that of Node-RED.
  • Scalability: Retain the extensibility of Node-RED, supporting custom nodes.
  • Easy Migration: Easily replace the existing Node-RED backend with minimal modifications.

Quick Start

0. Install Node-RED

For the purpose of testing this project, we first need to install Node-RED as our flow designer and generate the flows.json file. Please refer to the Node-RED documentation for its installation and usage.

After completing the flow design in Node-RED, please ensure that you click the big red "Deploy" button to generate the flows.json file. By default, this file is located in ~/.node-red/flows.json. Be mindful not to use Node-RED features that are not yet implemented in this project.

1. Build

cargo build -r

Note for Windows Users: Windows users should ensure that the patch.exe program is available in the %PATH% environment variable to successfully compile the project using rquickjs. This utility is required to apply patches to the QuickJS library for Windows compatibility. If Git is already installed, it will include patch.exe.

2. Run

cargo run -r

Or:

./target/release/edgelinkd

By default, EdgeLink will read ~/.node-red/flows.json and execute it.

Run Unit Tests

cargo test --all

Run Integration Tests

Running integration tests requires first installing Python 3.9+ and the corresponding Pytest dependencies:

pip install -U -r ./tests/requirements.txt

Then execute the following command:

cargo build -r
python -B -m pytest tests

Configuration

Adjust various settings in the configuration file, such as port number, flows.json path, etc. Refer to CONFIG.md for more information.

Project Status

Prototype Stage: The project is currently in the prototype stage and cannot guarantee stable operation.

Node-RED Features Roadmap:

  • Flow
  • Sub-flow
  • Group
  • Environment Variables (WIP)
  • Context
  • RED.util (WIP)
    • RED.util.cloneMessage()
    • RED.util.generateId()
  • Plug-in subsystem (WIP)

The Current Status of Nodes:

  • Core nodes:
    • Common nodes:
      • Console-JSON (For integration tests)
      • Inject
      • Debug (WIP)
      • Complete
      • Catch
      • Status
      • Link In
      • Link Call
        • Static Target
        • Dynamic Target
      • Link Out
      • Comment (Ignore automatically)
      • GlobalConfig (WIP)
      • Unknown
      • Junction
    • Function nodes:
      • Function (WIP)
        • Basic functions
        • node object
        • context object
        • flow object
        • global object
        • RED object
        • env object
      • Switch
      • Change
      • Range
      • Template
      • Delay
      • Trigger
      • Exec
      • Filter
    • Network nodes:
      • MQTT In
      • MQTT Out
      • HTTP In
      • HTTP Response
      • HTTP Request
      • WebSocket In
      • WebSocket Out
      • TCP In
      • TCP Out
      • TCP Request
      • UDP In
      • UDP Out
        • Unicast
        • Multicast (WIP)
      • TLS
      • HTTP Proxy
    • Sqeuence nodes:
      • Split
      • Join
      • Sort
      • Batch
    • Parse nodes:
      • CSV
      • HTML
      • JSON
      • XML
      • YAML
    • Storage
      • Write File
      • Read File
      • Watch

Roadmap

Check out our roadmap to get a glimpse of the upcoming features and milestones.

Contribution

Alt

Contributions are always welcome! Please read CONTRIBUTING.md for more details.

If you want to support the development of this project, you could consider buying me a beer.

Buy Me a Coffee at ko-fi.com

Support via PayPal.me

Known Issues

Please refer to ISSUES.md for a list of known issues and workarounds.

Feedback and Support

We welcome your feedback! If you encounter any issues or have suggestions, please open an issue.

E-mail: oldrev(at)gmail.com

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for more details.

Copyright © Li Wei and other contributors. All rights reserved.

About

EdgeLink: A Node-RED compatible run-time engine in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published