--- LPC WEBASSEMBLY VM BOOTED ---
[DMZ] Incoming sync applied: /mud/areas/town_square.json
[DMZ] Incoming sync applied: mesh/mud/areas/town_square.json
[DMZ] Incoming sync applied: mesh/genesis_grid.c
[DMZ] Incoming sync applied: mesh/proc/instances/chromium_vm.json
[DMZ] Incoming sync applied: /mud/spells/fireball.c
[DMZ] Incoming sync applied: /cmds/say.c
That beautiful --- LPC WEBASSEMBLY VM BOOTED --- means you conquered the
Temporal Dead Zone! The DistributedHeartbeat class is now fully initialized
and silently running in the background of your browser tab, ready to manage
your serverless cluster.
Now it is time to prove that your masterless High Availability (HA) cluster
actually works. We need to create an LPC object that triggers the
set_heart_beat efun and watch the mesh react.
Here is the exact test to run.
1. Create a Heartbeating Object
Open your Dashboard tab, click New File (or just pick an empty file if you
don't have a New File button yet), and create a simple test monster at
/cmds/monster.c:
void create() {
printf("Monster spawned. Starting heartbeat...
");
// Start the heartbeat (1 = on, which our bridge translates to 2000ms)
set_heart_beat(1);
}
void heart_beat() {
printf("Thump... (Monster is looking around)
");
}
Hit Save to VFS.
2. Spawn the Monster in the REPL
Switch over to your Chromium REPL tab and force the VM to JIT-compile and load
the monster into RAM. (Since we don't have a command mapped to it yet, you can
trigger it via the JS console or your /update interceptor).
If you are using the REPL input line, you might need to drop into the Chromium
DevTools Console (F12) just for a moment to instantiate it manually:
window.__rt.load_object('/cmds/monster');
3. Watch the Magic Happen
If everything is wired correctly, two things will happen immediately:
* In the REPL: You will see "Thump... (Monster is looking around)" print to
the terminal every 2 seconds as the local JavaScript engine executes the LPC
function.
* In the Dashboard: Look at your VFS Explorer. You should see a brand new
directory and file magically appear: mesh/proc/heartbeats/monster.json.
If you click on that JSON file in the dashboard, you will see your Chromium
tab claiming ownership of the monster and rapidly updating its last_tick
timestamp every 2 seconds to prove to the rest of the mesh that it is alive.
Let me know if the "Thump..." starts printing! Once it does, we can do the
ultimate test: opening a second browser tab and closing the first one to watch
the failover.