mirror of
https://github.com/Permissionless-Software-Foundation/psf-memo-db.git
synced 2026-09-21 16:52:02 -07:00
eac6fcb66cbf5dacc9472103920aeedc5809285c
psf-memo-db
LevelDB REST API for the Memo protocol indexer. Architecture mirrors psf-slp-db.
Database-focused architecture notes live in the indexer repo: psf-memo-indexer/dev-docs/psf-memo-db.md.
Requirements
- node ^20
- npm ^10
Installation
cd psf-memo-db
npm install
cp .env-example .env # optional
npm start
Default port: 5021
API
All indexer data is exposed under /level/* with CRUD routes per entity (post, like, name, profile, status, etc.) plus:
GET /profile/recent— paginated list of profiles, sorted by block height (newest first)POST /level/backup— zip database snapshotPOST /level/restore— restore from snapshot (exits process)GET /health— health check
List recent profiles
# First page (default limit 100)
curl -sS "http://localhost:5021/profile/recent"
# Page size and offset
curl -sS "http://localhost:5021/profile/recent?limit=50&offset=50"
Query parameters: limit (default 100, max 100), offset (default 0). Block height comes from the profile tx’s ptx record.
Tests
npm test
Production (Docker)
The production Docker setup is in psf-memo-indexer/production/docker (compose builds memo-db from this repo).
License
MIT
Languages
JavaScript
100%