- Rust 90.3%
- Shell 7.6%
- HTML 0.9%
- V 0.7%
- Makefile 0.5%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| _archive | ||
| benches | ||
| bin | ||
| docs | ||
| examples | ||
| lib | ||
| scripts | ||
| specs/schemas | ||
| tests | ||
| .gitignore | ||
| buildenv.sh | ||
| Cargo.toml | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
hero_coordinator
What this is
hero_coordinator (Horus) is a comprehensive monorepo workspace for Hero infrastructure components, consolidating job orchestration, runner management, domain models with Redis persistence, and Rhai scripting integration into a single, well-organized codebase.
The supervisor provides job lifecycle management (create, start, stop, delete), runner registration and management, Redis-based job queuing, and an OpenRPC JSON-RPC API with authentication. Domain models include 19 types with consistent patterns: BaseData (common fields like id, namespace, timestamps, tags), type-safe Builder Pattern construction via derive_builder, and optional Rhai scripting support.
What this repository contains
bin/supervisor— Job orchestration and runner management daemonbin/runners/sal— System Abstraction Layer runnerlib/models— 19 domain models with Redis persistence (Note, Account, User, Group, Membership, Invoice, Expense, Event, KycInfo, Contract, Verification, FlowTemplate, FlowInstance, Asset, Transaction, and more)lib/models/job— Job model types and builderslib/clients/supervisor— OpenRPC client (native + WASM)lib/clients/job— Redis-based job clientlib/runner— Core runner library for executing jobslib/rhai— Rhai integration macros and derives
Role in the stack
Part of the Hero infrastructure layer. The supervisor orchestrates jobs across runners, manages their lifecycle, and provides an OpenRPC JSON-RPC API with authentication. Models provide a consistent domain layer with Redis-backed persistence. This component integrates with other Hero services to provide centralized job management and execution.
Relation to ThreeFold
This technology is used within the ThreeFold ecosystem and was first deployed on the ThreeFold Grid. The component itself is designed as reusable infrastructure technology and should be understood by its technical function first, independent of any specific deployment.
Ownership
This repository is owned and maintained by TF-Tech NV, a Belgian company responsible for the development and maintenance of this technology.
License
This project is licensed under the Apache License 2.0 — see the LICENSE file for details.
Building
Build everything
cargo build --workspace
Build supervisor binary
cargo build -p hero-supervisor
Build client library
cargo build -p hero-supervisor-openrpc-client
Running
Start the supervisor
cargo run -p hero-supervisor -- \
--bind-address 127.0.0.1 \
--port 3030 \
--redis-url redis://127.0.0.1:6379
With configuration file
cargo run -p hero-supervisor -- --config config.toml
Development
Run tests
cargo test --workspace
Check all code
cargo check --workspace
Format code
cargo fmt --all
Lint
cargo clippy --workspace -- -D warnings
Dependencies
- Rust: 1.70+
- Redis: Required for job queuing
Installation
hero_coordinator is installed via heroscripts and herolib installers. This ensures safe, replicable, and versioned installation. See installation heroscript.