mirror of
https://github.com/Permissionless-Software-Foundation/psf-memo-indexer.git
synced 2026-09-21 16:52:02 -07:00
7f54613c559b934af80d4fb34a970e84c2550546
psf-memo-indexer
Indexes Memo protocol transactions on Bitcoin Cash. Architecture mirrors psf-slp-indexer-g2.
Overview
Two processes:
- Block indexer — IBD from block 525000, then ZMQ new-block processing
- TX indexer — mempool transactions via ZMQ after IBD signals
/tx-start
Data is stored in psf-memo-db via REST.
Developer documentation
Architecture, theory of operation, and design tradeoffs: dev-docs/.
Requirements
- node ^20
- npm ^10
- BCH full node (RPC + ZMQ)
- Running psf-memo-db
Installation
cd psf-memo-indexer
npm install
cp .env-example .env
Usage
Start the database:
cd ../psf-memo-db && npm start
Block indexer:
npm run block-indexer
TX indexer (separate terminal):
npm run tx-indexer
Configuration
See .env-example. Key variables:
| Variable | Default | Description |
|---|---|---|
PSF_MEMO_DB_URL |
http://localhost:5021 |
psf-memo-db URL |
START_BLOCK_HEIGHT |
525000 |
First block to index |
RPC_IP / RPC_PORT |
172.17.0.1 / 8332 |
Full node RPC |
ZMQ_PORT |
28332 |
Full node ZMQ |
TX_REST_API_PORT |
5455 |
TX indexer control API |
FILTER_CONCURRENCY |
20 |
Parallel Memo tx detection per block |
MEMO_TX_CONCURRENCY |
20 |
Parallel Memo tx processing per block |
DEBUG_LEVEL |
0 |
0 = block summary only; 1 = log each Memo tx action type and success/failure |
Tests
npm test
Production (Docker)
Docker files live under production/docker, matching psf-slp-indexer-g2:
cd production/docker
cp block-indexer/.env-example block-indexer/.env
cp tx-indexer/.env-example tx-indexer/.env
cp memo-db/.env-example memo-db/.env
docker-compose build
docker-compose up -d
Services: memo-db (port 5021), block-indexer, tx-indexer (port 5455).
License
GPL v3
Languages
JavaScript
90.3%
Dockerfile
9.5%
Shell
0.2%