feat: resource caps, Saved Messages, author walls, docs for node bring-up
Node flags (cmd/node/main.go):
--max-cpu / --max-ram-mb — Go runtime caps (GOMAXPROCS / GOMEMLIMIT)
--feed-disk-limit-mb — hard 507 refusal for new post bodies over quota
--chain-disk-limit-mb — advisory watcher (can't reject blocks without
breaking consensus; logs WARN every minute)
Client — Saved Messages (self-chat):
- Auto-created on sign-in, pinned top of chat list, blue bookmark avatar
- Send short-circuits the relay (no encrypt, no fee, no mailbox hop)
- Empty state rendered outside inverted FlatList — fixes the mirrored
"say hi…" on Android RTL-aware layout builds
- PostCard shows "You" for own posts instead of the self-contact alias
Client — user walls:
- New route /(app)/feed/author/[pub] with infinite-scroll via
`created_at` cursor and pull-to-refresh
- Profile screen gains "View posts" button (universal) next to
"Open chat" (contact-only)
Feed pipeline:
- Bump client JPEG quality 0.5 → 0.75 to match server scrubber (Q=75),
so a 60 KiB compose doesn't balloon past 256 KiB after server re-encode
- ErrPostTooLarge now wraps with the actual size vs cap, errors.Is
preserved in the HTTP layer
- FeedMailbox quota + DiskUsage surface — supports new CLI flag
README:
- Step-by-step "first node / joiner" section on the landing page,
full flag tables incl. the new resource-cap group, minimal
checklists for open/private/low-end deployments
This commit is contained in:
@@ -367,6 +367,39 @@ export interface IdentityInfo {
|
||||
registered: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Relay registration info for a node pub key, as returned by
|
||||
* /api/relays (which comes back as an array of RegisteredRelayInfo).
|
||||
* We don't wrap the individual lookup on the server — just filter the
|
||||
* full list client-side. It's bounded (N nodes in the network) and
|
||||
* cached heavily enough that this is cheaper than a new endpoint.
|
||||
*/
|
||||
export interface RegisteredRelayInfo {
|
||||
pub_key: string;
|
||||
address: string;
|
||||
relay: {
|
||||
x25519_pub_key: string;
|
||||
fee_per_msg_ut: number;
|
||||
multiaddr?: string;
|
||||
};
|
||||
last_heartbeat?: number; // unix seconds
|
||||
}
|
||||
|
||||
/** GET /api/relays — all relay nodes registered on-chain. */
|
||||
export async function getRelays(): Promise<RegisteredRelayInfo[]> {
|
||||
try {
|
||||
return await get<RegisteredRelayInfo[]>('/api/relays');
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/** Find relay entry for a specific pub key. null if the address isn't a relay. */
|
||||
export async function getRelayFor(pubKey: string): Promise<RegisteredRelayInfo | null> {
|
||||
const all = await getRelays();
|
||||
return all.find(r => r.pub_key === pubKey) ?? null;
|
||||
}
|
||||
|
||||
/** Fetch identity info for any pubkey or DC address. Returns null on 404. */
|
||||
export async function getIdentity(pubkeyOrAddr: string): Promise<IdentityInfo | null> {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user