decentralised sync engine
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add warning if no connected shards

serenity 0856d32d 7da32dd4

+11 -1
+11 -1
src/index.ts
··· 1 1 import { OWNER_DID, SERVER_PORT, SERVICE_DID } from "@/lib/env"; 2 2 import { performHandshakes } from "@/lib/setup"; 3 - import { setRegistrationState } from "@/lib/state"; 3 + import { handshakeTokens, setRegistrationState } from "@/lib/state"; 4 4 import type { AtUri } from "@/lib/types/atproto"; 5 5 import { getRecordFromAtUri } from "@/lib/utils/atproto"; 6 6 import { newErrorResponse } from "@/lib/utils/http/responses"; ··· 92 92 attachLatticeRegistrationListener(prismWebsocket); 93 93 94 94 await performHandshakes(latticeAtUri); 95 + 96 + // TODO: change this to the actual WS sessions 97 + const handshakeTokenEntries = handshakeTokens.entries().toArray(); 98 + 99 + if (handshakeTokenEntries.length === 0) { 100 + console.warn("Warning: there are zero handshake tokens on this Lattice."); 101 + console.warn("If you're hacking locally, you might want to make sure that there's a running Shard as well.") 102 + // NOTE: might change in the future 103 + console.warn("Channel records connecting a Lattice to a Shard are not supported now. Dev lattices must point to a dev Shard if both are running locally") 104 + } 95 105 }; 96 106 97 107 main()