- Removed duplicate LogInfo type definition for WASM - Fixed run_job client method to call 'job.run' instead of 'run_job' - Removed unused imports (wasm_bindgen, PathBuf) - Admin UI now builds successfully All components working: - OpenRPC client compiles for both native and WASM - Admin UI builds without errors - Method names aligned between client and server
OSIRIS + OpenRPC Comprehensive Example
This example demonstrates the complete workflow of using Hero Supervisor with OSIRIS runners via OpenRPC.
What This Example Does
- Builds and starts Hero Supervisor with OpenRPC server enabled
- Builds the OSIRIS runner binary
- Connects an OpenRPC client to the supervisor
- Registers and starts an OSIRIS runner
- Dispatches multiple jobs via OpenRPC:
- Create a Note
- Create an Event
- Query stored data
- Test access control (expected to fail)
- Monitors job execution and results
- Gracefully shuts down all components
Prerequisites
IMPORTANT: Redis must be running before starting this example!
# Start Redis (if not already running)
redis-server
Other requirements:
- Redis server running on
localhost:6379 - Rust toolchain installed
- Both
supervisorandrunner_rustcrates available
Running the Example
cargo run --example osiris_openrpc
Job Scripts
The example uses separate Rhai script files for each job:
note.rhai- Creates and stores a Note objectevent.rhai- Creates and stores an Event objectquery.rhai- Queries and retrieves stored objectsaccess_denied.rhai- Tests access control (should fail)
Architecture
┌─────────────────┐
│ This Example │
│ (OpenRPC │
│ Client) │
└────────┬────────┘
│ JSON-RPC
↓
┌─────────────────┐
│ Supervisor │
│ (OpenRPC │
│ Server) │
└────────┬────────┘
│ Redis Queue
↓
┌─────────────────┐
│ OSIRIS Runner │
│ (Rhai Engine │
│ + HeroDB) │
└─────────────────┘
Key Features Demonstrated
- Automatic binary building using escargot
- OpenRPC communication between client and supervisor
- Runner registration with configuration
- Job dispatching with signatories
- Context-based access control in OSIRIS
- Typed object storage (Note, Event)
- Graceful shutdown and cleanup
Expected Output
The example will:
- ✅ Create a Note successfully
- ✅ Create an Event successfully
- ✅ Query and retrieve stored objects
- ✅ Deny access for unauthorized participants
- ✅ Clean up all resources
Troubleshooting
Redis Connection Error:
- Ensure Redis is running:
redis-server
Build Errors:
- Ensure both supervisor and runner_rust crates are available
- Check that all dependencies are up to date
OpenRPC Connection Error:
- Port 3030 might be in use
- Check supervisor logs for startup issues