Fork of strfry with HTTP REST API support.
Chainlink's Crypto Risk Engine (CRE) doesn't support WebSocket. This adds HTTP endpoints so CRE can submit/retrieve Nostr events without modifying the core relay logic.
Config (strfry.conf
):
relay {
http {
enabled = true
port = 8080
bind = "0.0.0.0"
cors = true
}
}
Build:
git clone --recursive https://github.com/your-org/strfry && cd strfry
git submodule update --init
make setup-golpe
make -j$(nproc)
./strfry relay
Docker:
ports:
- "7777:7777" # WebSocket
- "8080:8080" # HTTP
Submit a Nostr event.
curl -X POST http://localhost:8080/api/quotes \
-H "Content-Type: application/json" \
-d '{"id":"...","pubkey":"...","created_at":123,"kind":1,"tags":[],"content":"...","sig":"..."}'
Response: {"ok": true, "message": "Quote accepted", "id": "..."}
Retrieve event by ID.
curl http://localhost:8080/api/quotes/abc123...
Health check: {"status": "ok", "service": "strfry-http"}
HTTP (CRE) ──┐
├──> Ingester ──> Validation ──> Database
WebSocket ───┘
Both protocols share the same validation, whitelist checking, and storage pipeline. See the main strfry documentation for details on the core architecture.
- ✅ Added HTTP REST API (ports 8080 + 7777)
- ✅ Same security/validation as WebSocket
- ✅ Zero changes to core strfry functionality
- ✅ Hot-reload config support for HTTP settings
Option | Default | Description |
---|---|---|
relay.http.enabled |
false |
Enable HTTP API |
relay.http.port |
8080 |
HTTP port |
relay.http.bind |
"127.0.0.1" |
Bind address |
relay.http.cors |
true |
Enable CORS |
- strfry documentation - Core relay features
- Plugin system - Write policies
- Negentropy sync - Set reconciliation
GPLv3 - Same as strfry