Nearest floor
The SDK can ask control which region is closest, then point the client at that node. The public demo picks its floor on the server from the country header instead. Your app does it if you ship more than one world.
createInterludeClient takes an address and a node URL. It does not pick them. The public demo has eight worlds, so something has to choose the nearest pair. In the demo that is its own server: it reads the platform’s country header on the page request and renders the tab with that floor, with no extra round trip. In your own page, nearestFloor() asks control instead.
import { createInterludeClient, nearestFloor } from "@interludelayer-sdk/sdk";
const floor = await nearestFloor();
export const interlude = createInterludeClient({
app: floor.app,
abi: demoAbi,
node: floor.node,
base,
});nearestFloor() calls https://control.interludelayer.xyz/near and looks up the eight public demo worlds. When control cannot tell the region, it returns the eu floor. Pass your own map if you shipped more than one contract, one per region, the same way.
Your single shipped app has one node. Sit it next to the people who tap when you run ship. There is nothing to look up after that.
Control can only tell the region from what the platform in front of it adds to the request: a country header or the Fly edge that took the connection. Without either, /near returns null and the helper falls back to the eu floor (fallback changes it). The demo’s server does the same when the request carries no country. Call nearestFloor() in the browser: from a server, control sees the server, not the visitor.
