Skip to content
Get started

How servers get their bundles

View as Markdown

The registry keeps what each server should run. A server gets that desired state every time it connects, so it never has to catch up on what happened while it was away.

  1. Bundles are stored by their SHA-256 on Cloudflare R2, readable only by the network’s servers. Revisions and assignments live in the network’s Durable Object.
  2. The server’s connector keeps a signed control channel to that object. When it connects, and whenever an assignment changes, the object works out the bundles for the server’s labels and platform and sends their names and hashes.
  3. The connector compares the hashes with the files in plugins/Minekube/games/, downloads only what is missing or different, checks each hash and writes the file atomically. It removes bundles it wrote that are no longer assigned. It leaves files it did not write, such as what mk dev installed, alone.
  4. The Minekube plugin sees the new file, loads it on a thread of its own and swaps it in on the server thread, as on the dev server. A bundle that fails to load never replaces the running one.

The bundles stay on the server’s disk, so a server starts with its last revision even when the registry is unreachable.

  • A server that was offline catches up by itself. It gets the current state when it connects, not a list of events it missed.
  • A new server needs no setup. Its labels decide what it runs from the moment it joins.
  • A rollback is the same operation as a publish. It changes the desired state, and every server converges to it.

Was this helpful?