SkillAgentSearch skills...

HydraMesh

The HydraMesh is an open-source evolution of the DeMoD Secure Protocol (DSP), designed as a shareware version to promote community-driven development. Please reach out if you have any questions.

Install / Use

/learn @ALH477/HydraMesh

README

HydraMesh

logo

Version 5.0.1 | Oct 10, 2025
Developed by DeMoD LLC
Contact: alh477@demod.ltd

License: License: LGPL v3
gpl

Overview

HydraMesh is a free and open-source software (FOSS) framework evolved from the DeMoD Secure Protocol, designed for low-latency, modular, and interoperable data exchange. It supports applications like IoT messaging, real-time gaming synchronization, distributed computing, and edge networking. HydraMesh features a handshakeless design, efficient Protocol Buffers serialization, and a compatibility layer for UDP, TCP, WebSocket, and gRPC transports, enabling seamless peer-to-peer (P2P) networking with self-healing redundancy.

HydraMesh is hardware and language agnostic, supporting embedded devices (e.g., Raspberry Pi), cloud servers, and mobile platforms (Android/iOS) with bindings in Perl, Python, C, C++, JavaScript (Node.js), Go, Rust, Java/Kotlin, Swift, and Lisp. Version 5.0.0 introduces a plugin system for custom modules and transports, an AUTO mode for dynamic role assignment managed by a master node, and enhanced extensibility. Licensed under GPL-3.0, HydraMesh ensures open-source derivatives. It includes CLI, TUI, server/client logic, P2P, and AUTO modes, making it versatile for standalone tools, libraries, or networked services. SDKs (e.g., C SDK, HydraMesh-Lisp SDK) are developed as submodules for streamlined integration.

The bash scripts are there to help you set up your environment. There are Nix and Docker presets. You're welcome.

<img width="3888" height="2208" alt="image" src="https://github.com/user-attachments/assets/1294e4e6-906c-42ef-af0d-c192056803ea" />

HYDRA Acronym

The name HydraMesh reflects its core strengths: a self-healing, decentralized mesh with proxy-like adaptability. The acronym HYDRA stands for:

| Letter | Meaning | Feature | Description | |--------|---------|---------|-------------| | H | Highly | Performance | Sub-millisecond latency with <1% overhead, ideal for gaming and real-time apps. | | Y | Yielding | Adaptive Routing | AI-driven topology optimization using Dijkstra and RTT-based grouping. | | D | Decentralized | P2P Mesh | No single point of failure, with AUTO mode for dynamic role switching. | | R | Resilient | Self-Healing | Automatic failover and redundancy, recovering peers in <50ms. | | A | Adaptive | Proxy Middleware | Plugin system and transport switching (e.g., gRPC, LoRaWAN) for flexible data relay. |

Important: HydraMesh complies with U.S. export regulations (EAR and ITAR). It avoids encryption to remain export-control-free. Users must ensure custom extensions comply; consult legal experts for specific use cases. DeMoD LLC disclaims liability for non-compliant modifications.

Features

  • Modularity: Independent components with standardized APIs; plugin system for custom extensions.
  • Interoperability: Protocol Buffers and gRPC ensure cross-language (Perl, Python, C, C++, JS, Go, Rust, Java, Swift, Lisp) and cross-platform compatibility.
  • Low Latency: Sub-millisecond exchanges with <1% overhead; handshakeless design for real-time applications.
  • Flexibility: Compatibility layer for UDP, TCP, WebSocket, gRPC, and custom transports via plugins; supports mobile bindings.
  • Dynamic Role Assignment: AUTO mode allows nodes to switch between client, server, or P2P roles under master node control, enabling AI-driven network optimization.
  • Usability: CLI for automation, TUI for monitoring; server, client, P2P, and AUTO modes with logging; master node commands for role and config management.
  • Self-Healing P2P: Redundant paths, failure detection, RTT-based grouping (clusters by <50ms threshold), and optimized routing (Dijkstra with RTT weights).
  • Persistence: Integrated StreamDB for state, metrics, and message logging in HydraMesh-Lisp SDK, with potential extensions to other SDKs.
  • Open Source: GPL-3.0 ensures transparency and community contributions.

Architecture

graph TD
    A[HydraMesh Framework] --> B[CLI]
    A --> C[TUI]
    A --> D[Networking Layer]
    
    D --> E[Server Mode]
    D --> F[Client Mode]
    D --> G[P2P Mode]
    D --> H[AUTO Mode]
    H --> I[Master Node]
    I --> J[Role Assignment]
    I --> K[Config Management]
    I --> L[Metrics Collection]
    G --> M[Self-Healing Redundancy]
    M --> N[Peer Discovery]
    M --> O[Failure Detection]
    M --> P[RTT-Based Grouping]
    
    D --> Q[Transport Layer]
    Q --> R[WebSocket]
    Q --> S[UDP]
    Q --> T[TCP]
    Q --> U[gRPC]
    Q --> V[Custom Plugins]
    
    D --> W[Protocol Buffers]
    W --> X[Serialization/Deserialization]
    
    A --> Y[Language Bindings]
    Y --> Z[Perl]
    Y --> AA[Python]
    Y --> AB[C/C++]
    Y --> AC[Node.js]
    Y --> AD[Go]
    Y --> AE[Rust]
    Y --> AF[Java/Kotlin]
    Y --> AG[Swift]
    Y --> AH[Lisp]
    
    A --> AI[Platform Support]
    AI --> AJ[Embedded Devices]
    AI --> AK[Cloud Servers]
    AI --> AL[Mobile: Android/iOS]
    
    A --> AM[SDKs]
    AM --> AN[C SDK]
    AM --> AO[HydraMesh-Lisp SDK]
    AM --> AP[Future SDKs: Python, Perl, etc.]
    
    A --> AQ[Persistence Layer]
    AQ --> AR[StreamDB] 

Installation

Clone the repository with submodules:

git clone --recurse-submodules https://github.com/ALH477/DeMoD-Communication-Framework.git
cd DeMoD-Communication-Framework

Prerequisites

  • Perl: CPAN modules: JSON, IO::Socket::INET, Getopt::Long, Curses::UI, Google::ProtocolBuffers::Dynamic, Grpc::XS, Module::Pluggable.
  • Python: pip install protobuf grpcio grpcio-tools importlib.
  • C SDK: libprotobuf-c, libuuid, libdl, libcjson, cmake, ncurses.
  • C++: grpc, protobuf.
  • Node.js: grpc, protobufjs.
  • Go: go get google.golang.org/grpc, go get google.golang.org/protobuf.
  • Rust: tonic, prost (for gRPC/Protobuf).
  • Java/Kotlin (Android): io.grpc:grpc-okhttp, com.google.protobuf:protobuf-java.
  • Swift (iOS): GRPC-Swift, SwiftProtobuf.
  • Lisp: SBCL with Quicklisp; dependencies: cl-protobufs, cl-grpc, cffi, etc. (see lisp/src/hydramesh.lisp).
  • StreamDB: Build libstreamdb.so from streamdb/ using Cargo for persistence in HydraMesh-Lisp SDK.

Generating Protobuf/gRPC

Use protoc to generate bindings for each language:

  • Perl/Python: protoc --perl_out=perl/lib --python_out=python/dcf --grpc_out=python/dcf --plugin=protoc-gen-grpc_python=python -m grpc_tools.protoc messages.proto services.proto
  • C SDK: protoc --c_out=c_sdk/src messages.proto
  • C++: protoc --cpp_out=cpp/src --grpc_out=cpp/src --plugin=protoc-gen-grpc=grpc_cpp_plugin messages.proto services.proto
  • Node.js: protoc --js_out=import_style=commonjs:nodejs/src --grpc_out=nodejs/src --plugin=protoc-gen-grpc=grpc_node_plugin messages.proto services.proto
  • Go: protoc --go_out=go/src --go-grpc_out=go/src messages.proto services.proto
  • Rust: Use tonic-build in build.rs
  • Android: protoc --java_out=android/app/src/main --grpc_out=android/app/src/main --plugin=protoc-gen-grpc-java=grpc-java-plugin messages.proto services.proto
  • iOS: protoc --swift_out=ios/Sources --grpc-swift_out=ios/Sources messages.proto services.proto
  • Lisp: protoc --lisp_out=lisp/src messages.proto services.proto

Building SDKs

  • C SDK: cd c_sdk && mkdir build && cd build && cmake .. && make
  • Perl: cpanm --installdeps .
  • Python: pip install -r python/requirements.txt
  • Lisp: Load via SBCL: (load "lisp/src/hydramesh.lisp")
  • Others: Follow language-specific build tools (e.g., cargo build for Rust).

Examples

Perl (gRPC Client)

# perl/hydramesh.pl
use Grpc::XS;
use HydraMesh::Messages qw(HydraMeshMessage);
my $client = Grpc::XS::channel('localhost:50051');
my $stub = $client->service('HydraMeshService');
my $request = HydraMeshMessage->new(data => 'Hello');
my $response = $stub->SendMessage($request);
print $response->{data}, "\n";

Python (gRPC Client)

# python/hydramesh.py
import grpc
from hydramesh.services_pb2_grpc import HydraMeshServiceStub
from hydramesh.messages_pb2 import HydraMeshMessage
channel = grpc.insecure_channel('localhost:50051')
stub = HydraMeshServiceStub(channel)
request = HydraMeshMessage(data='Hello')
response = stub.SendMessage(request)
print(response.data)

C SDK (Client)

// c_sdk/examples/client.c
#include <hydramesh_sdk/hydramesh_client.h>
int main() {
    HydraMeshClient* client = hydramesh_client_init("config.json");
    hydramesh_client_start(client);
    hydramesh_client_send(client, "Hello", "peer1");
    hydramesh_client_stop(client);
    return 0;
}

C++ (gRPC Server)

// cpp/src/hydramesh.cpp
#include <grpcpp/grpcpp.h>
#include "services.grpc.pb.h"
class ServerImpl final : public HydraMeshService::Service {
    grpc::Status SendMessage(grpc::ServerContext* context, const HydraMeshMessage* request, HydraMeshMessage* response) override {
        response->set_data("Echo: " + request->data());
        return grpc::Status::OK;
    }
};
int main() {
    grpc::ServerBuilder builder;
    builder.AddListeningPort("0.0.0.0:50051", grpc::InsecureServerCredentials());
    ServerImpl service;
    builder.RegisterService(&service);
    std::unique_ptr<grpc::Server> server(builder.BuildAndStart());
    server->Wait();
    return 0;
}

Node.js (gRPC Client)

// nodejs/src/hydramesh.js
const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');
const packageDefinition = protoLoader.loadSync(['messages.proto', 'services.proto']);
const hydrameshProto = grpc.loadPackageDefinition(packageDefinition).hydramesh;
const clie

Related Skills

View on GitHub
GitHub Stars22
CategoryDevelopment
Updated16d ago
Forks4

Languages

C

Security Score

95/100

Audited on Mar 22, 2026

No findings