Load protection (public read-only endpoint — protects relays + this box): - Per-pubkey sliding-window throttle and in-flight cap via inbound middleware. The transport can't return a JSON-RPC error, so over-budget callers are dropped and time out (logged). - Global semaphore caps concurrent upstream relay queries. - Short-TTL cache keyed by filter set, so repeated identical queries (e.g. a burst of get_community_stats) don't re-hit the relays. - All tunable via CVM_RATE_* / CVM_MAX_* / CVM_QUERY_CACHE_MS (documented in .env.example); maps pruned by a janitor. CI: - cvm-server/tsconfig.json type-checks the standalone server; new typecheck:cvm / check:cvm scripts, with typecheck:cvm wired into npm test so the server can't rot unnoticed (it was excluded from tsc + eslint).
16 lines
492 B
JSON
16 lines
492 B
JSON
{
|
|
// Type-checks the standalone Bun server. It is deliberately separate from the
|
|
// app's root tsconfig (which only includes `src`) and is run by `npm test`
|
|
// via the `typecheck:cvm` script, so the server can't silently rot.
|
|
"compilerOptions": {
|
|
"target": "ES2022",
|
|
"module": "ESNext",
|
|
"moduleResolution": "bundler",
|
|
"lib": ["ESNext"],
|
|
"types": ["node"],
|
|
"esModuleInterop": true,
|
|
"skipLibCheck": true,
|
|
"noEmit": true
|
|
},
|
|
"include": ["server.ts"]
|
|
}
|