A5: Relay Network
Santa's sleigh talks to the workshop through a mesh of relay satellites, and nobody has a map of it. Each relay only knows its own outbound links. You'll have to crawl the mesh from the workshop's root relay to find the beacon on the sleigh.
Send Authorization: Bearer YOUR_TOKEN with every request (401 without it). Errors are JSON {"error": "...", "detail": "..."}.
GET https://outcoded.orimovo.co.uk/api/v1/orbit/A5/network tells you where to start and what you're looking for:
curl -H "Authorization: Bearer YOUR_TOKEN" https://outcoded.orimovo.co.uk/api/v1/orbit/A5/network
{"root": "1a2b3", "beacon": "f00d5", "start": {"href": "nodes/1a2b3"}}
GET https://outcoded.orimovo.co.uk/api/v1/orbit/A5/nodes/:id returns one relay and its outbound links. Links are one-way. Each link's href is relative to https://outcoded.orimovo.co.uk/api/v1/orbit/A5/, and latency is in milliseconds:
curl -H "Authorization: Bearer YOUR_TOKEN" https://outcoded.orimovo.co.uk/api/v1/orbit/A5/nodes/1a2b3
{"id": "1a2b3", "callsign": "HOLLY", "self": {"href": "nodes/1a2b3"},
"links": [
{"id": "77c01", "href": "nodes/77c01", "latency": 42},
{"id": "b3e9a", "href": "nodes/b3e9a", "latency": 7}
]}
An id that isn't a relay gets 404 with "error": "unknown_node".
The mesh is rate-limited to 20 requests per second. Responses carry RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset headers. Going over gets 429 with "error": "rate_limited" and Retry-After in seconds.
A route is a sequence of links from the root to the beacon, and its length is its number of links (hops). Traffic is shared equally between every route with the fewest possible hops. For example, if root R links to A and B, both link to C, and C links to the beacon, there are 2 fewest-hop routes (3 hops each).
How many different routes from the root to the beacon use the fewest possible hops?