feat: Multi-node connectivity via hero_proxy over Mycelium #83
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_compute#83
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
Enable hero_compute master/worker multi-node communication over Mycelium IPv6 using hero_proxy as the network layer. hero_router stays localhost-only (socket discovery + local routing). hero_proxy handles external traffic with Mycelium IPv6 binding.
Architecture
Changes Required
1. Fix port alignment (hero_compute)
hero_router port is 9988 per the hero_sockets skill spec. hero_compute SDK currently has
HERO_ROUTER_PORT = 9998which is wrong.HERO_ROUTER_PORT→HERO_PROXY_PORT = 9997ROUTER_SERVER_RPC_PREFIX→PROXY_SERVER_RPC_PREFIXROUTER_EXPLORER_RPC_PREFIX→PROXY_EXPLORER_RPC_PREFIXrouter_server_rpc_url()→proxy_server_rpc_url()router_explorer_rpc_url()→proxy_explorer_rpc_url()2. hero_proxy: Add socket-type URL routing (hero_proxy repo)
hero_proxy currently routes
/{service}/*and picks the first socket it finds (prefers ui.sock over rpc.sock). For multi-node, we need to reach specific sockets.Add hero_router-style routing:
/{service}/{socket_type}/*/{service}/rpc/*→{service}/rpc.sock/{service}/ui/*→{service}/ui.sock/{service}/explorer_rpc/*→{service}/explorer_rpc.sock/{service}/*behavior for backward compatibilityThis keeps URL formats consistent between hero_router (local) and hero_proxy (network).
Separate issue in hero_proxy repo.
3. hero_compute --start: Configure hero_proxy Mycelium listener
When starting in master or worker mode,
hero_compute --startshould:mycelium.infoRPC to get the local Mycelium IPv6listener.addRPC to create a listener on[mycelium-ipv6]:9997withauto_start=trueMYCELIUM_IPThis way the user doesn't need to manually configure hero_proxy.
4. Install script + central config
Add to central config (
hero_compute_config/development.toml):Update
scripts/install.sh:hero_router start)hero_proxy --start)Update
scripts/uninstall.shto clean up hero_router and hero_proxy.5. hero_router port fix (hero_router repo)
Update hero_router default port from 9998 to 9988 to match the hero_sockets skill spec.
Separate issue in hero_router repo.
6. Documentation
docs/setup.md— multi-node requires hero_proxy on each nodedocs/architecture.md— show hero_proxy in the flow diagramdocs/configuration.md— new env vars, remove hero_router port references.env.example— update URL format examplesDependencies
/{service}/{socket_type}/*) — separate issueAcceptance Criteria
hero_compute --start --mode masterconfigures hero_proxy Mycelium listenerhero_compute --start --mode worker --master-ip <mycelium-ipv6>sends heartbeats through hero_proxyRelated Issues
Implementation Spec for Issue #83
Objective
Enable hero_compute multi-node communication via hero_proxy over Mycelium IPv6, replacing the hero_router dependency for cross-node traffic.
Pre-completed
Files to Modify
crates/hero_compute_sdk/src/lib.rscrates/hero_compute_server/src/heartbeat_sender.rscrates/hero_compute_explorer/src/explorer/proxy.rscrates/hero_compute/src/main.rsscripts/install.shscripts/uninstall.sh.env.exampledocs/setup.mddocs/architecture.mddocs/configuration.mdImplementation Plan
Step 1: SDK — Rename router to proxy (Foundation)
Files:
crates/hero_compute_sdk/src/lib.rsHERO_ROUTER_PORTtoHERO_PROXY_PORT = 9997ROUTER_SERVER_RPC_PREFIXtoPROXY_SERVER_RPC_PREFIXROUTER_EXPLORER_RPC_PREFIXtoPROXY_EXPLORER_RPC_PREFIXrouter_server_rpc_url()toproxy_server_rpc_url()router_explorer_rpc_url()toproxy_explorer_rpc_url()http_rpc_tcp()andhttp_rpc_unix()unchangedDependencies: none
Step 2: Update heartbeat sender + explorer proxy
Files:
heartbeat_sender.rs,proxy.rsDependencies: Step 1
Step 3: CLI — hero_proxy Mycelium listener setup + write_env update
Files:
crates/hero_compute/src/main.rsDependencies: Step 1
Step 4: Install script — Add hero_router + hero_proxy
Files:
scripts/install.sh,scripts/uninstall.shhero_router starthero_proxy --startDependencies: none (parallel with Steps 1-3)
Step 5: Documentation
Files:
.env.example,docs/setup.md,docs/architecture.md,docs/configuration.mdDependencies: Steps 1-4
Acceptance Criteria
Implementation Summary
Changes
Test Results
PR: #85
Commit:
c6aeeb4