Skip to content

Repository files navigation

Arnelify Logo

Arnelify Broker for NodeJSNodeJSBun

🚀 About

Arnelify® Broker for NodeJS — a multi-language broker with RPC and UMQT support.

All supported protocols:

#ProtocolTransport
1TCP2UMQT
2UDPUMQT

📋 Minimal Requirements

Important: It's strongly recommended to use in a container that has been built from the gcc v15.2.0 image.

  • CPU: Apple M1 / Intel Core i7 / AMD Ryzen 7
  • OS: Debian 11 / MacOS 15 / Windows 10 with WSL2.
  • RAM: 4 GB

📦 Installation

Run in terminal:

yarn add arnelify-server

🎉 RPC

RPC - operates on top of the transport layer, enabling remote function and procedure calls.

📚 Examples

import{RPC,BrokerBytes,BrokerCtx,RPCStream}from"arnelify-server";(asyncfunctionmain(){constrpc: RPC=newRPC();rpc.logger((level: string,message: string): void=>{console.log(`[Arnelify Broker]: ${message}`);});rpc.on("connect",(ctx: BrokerCtx,bytes: BrokerBytes,stream: RPCStream): void=>{awaitstream.push(ctx,bytes);});const{ ctx, bytes }=awaitrpc.send_json("connect",{test: 1});console.log("ctx: ",ctx);console.log("bytes: ",bytes);})();

🎉 UMQT

UMQT (UDP Message Query Transport) - is a universal WEB3-transport designed for flexible transport-layer communication, supporting two messaging mechanisms: TCP2 and datagrams.

📚 Configuration

OptionDescription
BLOCK_SIZE_KBThe size of the allocated memory used for processing large packets.
CERT_PEMPath to the TLS cert-file in PEM format.
COMPRESSIONIf this option is enabled, the transport will use BROTLI compression if the client application supports it. This setting increases CPU resource consumption. The transport will not use compression if the data size exceeds the value of BLOCK_SIZE_KB.
KEY_PEMPath to the TLS private key-file in PEM format.
PORTDefines which port the transport will listen on.
THREAD_LIMITDefines the maximum number of threads that will handle requests.

📚 Examples

import{UMQT,UMQTBytes,UMQTConsumer,UMQTOpts}from"arnelify-server";(asyncfunctionmain(){constumqt_opts: UMQTOpts={block_size_kb: 64,cert_pem: "certs/cert.pem",compression: true,key_pem: "certs/key.pem",port: 4433,thread_limit: 4};constumqt=newUMQT(umqt_opts);umqt.add_server("connect","127.0.0.1",4433);umqt.logger((level: string,message: string): void=>{console.log(`[Arnelify Server]: ${message}`);});umqt.on("connect",(bytes: UMQTBytes): void=>{console.log("received: ",bytes);});umqt.start();})();

⚖️ MIT License

This software is licensed under the MIT License. The original author's name, logo, and the original name of the software must be included in all copies or substantial portions of the software.

🛠️ Contributing

Join us to help improve this software, fix bugs or implement new functionality. Active participation will help keep the software up-to-date, reliable, and aligned with the needs of its users.

Run in terminal:

docker compose up -d --build
docker ps
docker exec -it <CONTAINER ID> bash
yarn build

For RPC:

yarn test_rpc

For UMQT:

yarn test_umqt

⭐ Release Notes

Version 1.0.5 — a multi-language broker with RPC and UMQT support.

We are excited to introduce the Arnelify Broker for NodeJS! Please note that this version is raw and still in active development.

Change log:

  • UMQT support.
  • Async Runtime & Multi-Threading.
  • Block processing in "on-the-fly" mode.
  • BROTLI compression (still in development).
  • FFI, PYO3 and NEON support.
  • Significant refactoring and optimizations.

Please use this version with caution, as it may contain bugs and unfinished features. We are actively working on improving and expanding the broker's capabilities, and we welcome your feedback and suggestions.

🔗 Links

About

Arnelify® Broker for NodeJS - is a multi-language broker with RPC and UMQT support.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages