This runbook provides step-by-step procedures for common operational tasks in StellarStream.
For initial production setup, refer to the Deployment Guide.
- Reset SQLite Database
- Rotate JWT Secret
- Force Indexer Reconcile
- Requeue Dead-Letter Webhooks
- Archive Old Streams Manually
Prerequisites:
- Access to the server's filesystem.
- Backend service stopped (recommended).
Steps:
- Stop the backend service.
- Navigate to the
backend/datadirectory. - Delete the database file:
rm backend/data/streams.db
- Restart the backend service.
Expected Output:
- Backend logs show:
Database initialized.andmigrate()running. - A new
streams.dbfile is created.
Prerequisites:
- Access to the backend environment variables or
.envfile.
Steps:
- Generate a new random secret:
openssl rand -hex 32
- Update the
JWT_SECRETvalue in your environment orbackend/.envfile. - Restart the backend service.
Expected Output:
- All existing user sessions are invalidated.
- Users will be prompted to re-connect their wallets and sign a new challenge.
Prerequisites:
- Access to the backend environment variables.
Steps:
- Identify the ledger sequence number you want to re-index from.
- Set the
INDEXER_START_LEDGERenvironment variable:# Example: Re-index from ledger 1234567 export INDEXER_START_LEDGER=1234567
- Restart the backend service.
Expected Output:
- Backend logs show:
INDEXER_START_LEDGER override active: starting from ledger 1234567. - The indexer will process events starting from that ledger, potentially updating local records.
Prerequisites:
- An admin JWT or access to the database.
- The ID of the dead-letter record.
Steps:
- Get the list of dead-letter webhooks:
curl -H "Authorization: Bearer <ADMIN_TOKEN>" http://localhost:3001/api/webhooks/dead-letters - Re-queue a specific webhook using its ID:
curl -X POST -H "Authorization: Bearer <ADMIN_TOKEN>" http://localhost:3001/api/webhooks/dead-letters/<ID>/requeue
Expected Output:
- JSON response:
{ "success": true, "message": "Webhook re-queued successfully" }. - The record is moved from
webhook_dead_lettersback towebhook_deliveries.
Prerequisites:
- Node.js environment on the server.
Steps: Currently, archiving is defined in the codebase but not exposed via a CLI or API. To trigger it manually, you can use a small script:
- Create a file
archive.js:const { initDb } = require('./dist/services/db'); const { archiveOldStreams } = require('./dist/services/streamStore'); async function run() { initDb(); const archived = await archiveOldStreams(); console.log(`Archived ${archived} streams.`); process.exit(0); } run();
- Run the script:
node archive.js
Expected Output:
- Console log showing the number of streams archived (completed > 30 days ago).