Lesson 04 Livebook: Relay Deployment
The payload bay is open. The hull starts shedding children into the corridor.
Mix.install([
{:helios_fleet, path: "../04_relay_deployment"}
])
Application.ensure_all_started(:helios_fleet)
Helpers
alias HeliosFleet.LessonSupport
Deploy The Relay Chain
alias Jido.AgentServer
alias Jido.Signal
alias HeliosFleet
probe_id = LessonSupport.unique_agent_id("khepri")
{:ok, pid} = HeliosFleet.start_probe(probe_id)
{:ok, _probe} =
AgentServer.call(
pid,
Signal.new!(
"fleet.probe.relay_chain_requested",
%{
corridor: "icefall-west",
relays: ["port_relay", "starboard_relay"]
},
source: "/orpheus/mission"
)
)
{:ok, parent_state} = AgentServer.state(pid)
port_relay_pid = parent_state.children.port_relay.pid
{:ok, _relay} =
AgentServer.call(
port_relay_pid,
Signal.new!(
"relay.hold_corridor_assigned",
%{
corridor: "icefall-west",
vector: "port_arc"
},
source: "/khepri"
)
)
Process.sleep(50)
{:ok, updated_state} = AgentServer.state(pid)
LessonSupport.stop_probe_family(probe_id)
%{
relay_chain: updated_state.agent.state.relay_chain,
relay_boot_events: updated_state.agent.state.relay_boot_events,
relay_updates: updated_state.agent.state.relay_updates
}