Files
pwap/backend/package.json
T
pezkuwichain 80d273ff11 ci/cd(backend): offline test suite + Dockerize + audit-grade deploy (b + c)
Closes the "backend has zero CI + manual SSH deploy" audit finding for the indexer.

Part B — CI-runnable tests (the integration-tests/*.live.test.js need a live chain and
are excluded, not stubbed): extract injectable cores (indexer.js: DB+HTTP+decode, no
@pezkuwi import; council.js: createApp factory for the council/KYC routes). New node:test
suite (19/19, fully offline) — in-memory sqlite, dependency-injected chain stub, an
in-memory fake-supabase, and REAL @pezkuwi keyring signatures proving 401 bad-sig /
400 msg-mismatch / 200 valid / 409 dup / 403 non-member / threshold auto-execute. Backend
job now runs npm ci + npm test and is in ci-gate (failing tests block merge). Fixed a
latent bug: block indexing now awaits each insert (was fire-and-forget forEach). Added
runtime deps server.js imported but were missing from package.json (@supabase/supabase-js,
pino, pino-http) — server.js could not have `npm ci`-run before.

Part C — Dockerfile (non-root, HEALTHCHECK /health, sqlite state on a /data VOLUME kept
out of the image) + backend deploy pipeline mirroring the web one: build+push to GHCR,
cosign keyless sign + verify, ssh deploy with the DB volume preserved across deploys,
/health poll, auto-rollback to previous SHA, same Telegram CEO approval gate, main/tags
only, never fork PRs. New secrets documented in backend/DEPLOY.md (BACKEND_VPS_HOST/USER/
SSH_KEY). DB_PATH env (default ./transactions.db) lets prod point at the volume.

Note for owner: if server.js (council/KYC bootstrap) is legacy/unused, its newly-added
deps can be dropped instead.
2026-07-25 11:01:47 -07:00

54 lines
1.5 KiB
JSON

{
"name": "pezkuwi-indexer-service",
"version": "1.0.0",
"description": "Simple Transaction Indexer for Pezkuwi Chain",
"main": "src/index.js",
"type": "module",
"scripts": {
"start": "node src/index.js",
"dev": "node --watch src/index.js",
"test": "node --test test/*.test.js"
},
"overrides": {
"tar": "^7.5.22",
"ws": "^8.21.1",
"@pezkuwi/api": "^16.5.23",
"@pezkuwi/api-augment": "^16.5.23",
"@pezkuwi/api-base": "^16.5.23",
"@pezkuwi/api-derive": "^16.5.23",
"@pezkuwi/rpc-augment": "^16.5.23",
"@pezkuwi/rpc-core": "^16.5.23",
"@pezkuwi/rpc-provider": "^16.5.23",
"@pezkuwi/types": "^16.5.23",
"@pezkuwi/types-augment": "^16.5.23",
"@pezkuwi/types-codec": "^16.5.23",
"@pezkuwi/types-create": "^16.5.23",
"@pezkuwi/types-known": "^16.5.23",
"@pezkuwi/types-support": "^16.5.23",
"@pezkuwi/keyring": "^14.0.13",
"@pezkuwi/util": "^14.0.13",
"@pezkuwi/util-crypto": "^14.0.13",
"@pezkuwi/networks": "^14.0.13",
"@pezkuwi/x-bigint": "^14.0.13",
"@pezkuwi/x-randomvalues": "^14.0.13"
},
"dependencies": {
"@pezkuwi/api": "^16.5.23",
"@pezkuwi/util": "^14.0.13",
"@pezkuwi/util-crypto": "^14.0.13",
"@supabase/supabase-js": "^2.45.0",
"cors": "^2.8.5",
"dotenv": "^17.2.3",
"express": "^5.2.1",
"pino": "^9.5.0",
"pino-http": "^10.3.0",
"pino-pretty": "^11.3.0",
"sqlite": "^5.1.1",
"sqlite3": "^5.1.7"
},
"devDependencies": {
"@pezkuwi/keyring": "^14.0.13",
"supertest": "^7.0.0"
}
}