Let the owner change regions by place name, without a restart

The p2p node can now add and drop regions while running (SetRegions):
topics, validators, subscriptions and per-region peer discovery start and
stop with them, and a newly followed region catches up by sync.

PUT /api/v1/regions (owner token) applies a change and the node saves it in
regions.json, which wins over --region from then on. The owner's browser
gets a "Regions" page: search a place by name (GeoNames cities, offline,
CC BY 4.0), follow its cell plus any cell within about 40 km.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
2026-11-18 10:28:16 +01:00
co-authored by Claude Sonnet 5.5
parent e7bec4fb63
commit fd439710df
24 changed files with 70080 additions and 42 deletions
+5
View File
@@ -176,6 +176,11 @@ export async function deleteAddress(listing: string): Promise<void> {
}
/** Publishes a new listing. The node signs it and mines its proof-of-work, which takes a few seconds. */
/** Makes the node follow exactly these regions, now and after a restart; returns what it follows. */
export async function setRegions(regions: string[]): Promise<string[]> {
return ((await call("PUT", "/api/v1/regions", { regions })) as { regions: string[] }).regions;
}
export async function createListing(d: Draft): Promise<Listing> {
return (await call("POST", "/api/v1/listings", d)) as Listing;
}