Relayer
is the async request/response bridge for the Morpheus MiniApp OS kernel.In the current production architecture, the relayer sits between the on-chain request surface and the confidential execution plane. It persists chain-originated work before checkpoint advancement and routes execution to the correct runtime lane.
It closes the loop:
- MiniApp OS kernel request is emitted on-chain
- Relayer detects the event
- Relayer forwards the payload to the appropriate built-in module lane
- Relayer calls back on the kernel contract
- The kernel persists the canonical inbox item
- Optional external callback adapters receive the result when configured
Supported chains
- Neo N3
Request routing
The relayer is still migrating from legacy
routing to the kernel's model.Today it effectively maps legacy request taxonomy onto built-in module lanes:
The relayer maps
plus payload shape to worker routes:- → built-in compute module →
- / / → built-in shared resource module →
- / →
- and other legacy Oracle request types → built-in fetch/query module →
- / / → internally for operator sync only
- The relayer prefers the compact smart-fetch response over raw query output
Long-term target:
- requests should be interpreted as kernel requests
- built-in modules should remain reusable across many registered miniapps
- miniapps should not need their own generic relayer plumbing
Commands
Required env
- or /
- ( or )
- or
If direct worker-side provider default resolution is needed during relayer processing, also set:
- or
Reliability Model
The relayer persists:
- per-chain last scanned block checkpoints
- processed-event records for dedupe
- retry queue entries with exponential backoff
- dead-letter history for exhausted requests
- aggregate metrics for the latest runs
Config knobs:
Checkpoint note:
- if a saved checkpoint is ahead of the current confirmed chain tip, the relayer now resets that chain checkpoint to the configured start block instead of stalling forever
检查点说明:
- 如果已保存的 checkpoint 高于当前已确认链高度,relayer 现在会自动回退到配置的起始区块,而不是永久卡住
Neo N3 txproxy note:
- the Neo N3 txproxy allowlist now permits both and on the Morpheus kernel contract so automation executions can be queued on-chain through the compatibility path
Supabase Persistence
If
plus a service key are configured, the relayer also persists:- run snapshots to
- job lifecycle records to
The dashboard can read these through:
Manual operator actions:
These enqueue the stored event back into the relayer for manual retry / dead-letter replay.
State file
The relayer stores its durable runtime state in:
Override with:
Docker
Build and run:
systemd
Example unit file:
Typical install:
Phala Sidecar Pattern
A simple production pattern is:
- deploy to Phala
- run as a sidecar process on a small VM or container
- point at the public Morpheus runtime endpoint
- keep chain updater keys and Supabase service credentials only in the sidecar env