A Nostr relay and Blossom server for the Zapstore app ecosystem.
- Full Nostr relay implementation using rely
- NIP-11 relay information document
- NIP-42 authentication support
- Configurable allowed event kinds with structure validation
- Filter specificity scoring to reject overly vague queries
- SQLite-based event storage
- Full Blossom server implementation using blossy
- Bunny CDN integration for scalable blob delivery
- Configurable allowed media types (APKs, images)
- Deduplication: blobs are checked before upload to save bandwidth
- Local SQLite metadata store with CDN redirect for downloads
- Hot-reloadable CSV-based allow/block lists for:
- Pubkeys (allowed and blocked)
- Event IDs (blocked)
- Blob hashes (blocked)
- Configurable unknown pubkey policy:
ALLOW- allow all unknown pubkeysBLOCK- block all unknown pubkeysVERTEX- use Vertex DVM reputation filtering
- Reputation-based access control for unknown pubkeys
- Supports multiple ranking algorithms:
- Global PageRank
- Personalized PageRank
- Follower count
- Configurable reputation threshold
- In-memory LRU cache for rank lookups
- Token bucket rate limiting per IP group
- Configurable initial tokens, max tokens, and refill rate
- Different costs for different operations (connections, events, queries, uploads)
- Penalty system for misbehaving clients
- Go 1.25 or later
- A BunnyCDN account with a storage zone configured
- A Nostr secret key loaded with Vertex DVM credits
# Clone the repository
git clone https://github.com/zapstore/server.git
cd server
# Create and configure .env file
cp cmd/.env.example cmd/.env
# Edit cmd/.env with your configuration
# Build
go build --tags "fts5" -o zapstore-server ./cmd
# Run
./zapstore-serverOn first run, the server creates the following structure:
$SYSTEM_DIRECTORY_PATH/
├── data/
│ ├── relay.db # SQLite database for relay events
│ └── blossom.db # SQLite database for blob metadata
└── acl/
├── pubkeys_allowed.csv
├── pubkeys_blocked.csv
├── events_blocked.csv
└── blobs_blocked.csv
ACL files are CSV with two columns: identifier and reason. Lines starting with # are comments.
# Allowed pubkeys
# pubkey,reason
npub1abc...,Trusted developer
abc123...,Another trusted userFiles are hot-reloaded when modified - no server restart required.
- Relay:
ws://localhost:3334(or your configured port) - Blossom:
http://localhost:3335(or your configured port)