Choose even the first region in the browser; update Docker and Nix
A node now starts without any region (it only helps others connect, and prints a hint). The owner's sign-in link leads straight to the Regions page when none is followed, visitors get a notice instead of an empty search, and status always lists regions as an array. The Docker image no longer pins Bonn, the NixOS module no longer requires regions, and the VM test now starts without any, chooses the first region over the API and checks it survives a restart. README and the init hint follow. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
@@ -385,3 +385,24 @@ func TestRegionsChangeWhileRunning(t *testing.T) {
|
||||
t.Fatalf("regions changed to %v", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestANodeWithoutRegionsFollowsTheFirstOneWhenChosen(t *testing.T) {
|
||||
a := startNode(t, nil, "u1x")
|
||||
b := startNode(t, nil) // no region yet
|
||||
connect(t, b, a)
|
||||
if got := b.Regions(); len(got) != 0 {
|
||||
t.Fatalf("regions = %v", got)
|
||||
}
|
||||
l := a.listing(t, "u1xjhx")
|
||||
if err := a.Publish(context.Background(), l); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(300 * time.Millisecond)
|
||||
if count(b) != 0 {
|
||||
t.Fatal("a node without regions stored a listing")
|
||||
}
|
||||
if err := b.SetRegions([]string{"u1x"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
eventually(t, "the first region is followed and caught up", func() bool { return count(b) == 1 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user