Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

DUCAT-UNIT/strfry-http

Open more actions menu
 
 

Repository files navigation

Strfry HTTP API Extension

Fork of strfry with HTTP REST API support.

Why?

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.

Quick Start

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

API Endpoints

POST /api/quotes

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": "..."}

GET /api/quotes/:id

Retrieve event by ID.

curl http://localhost:8080/api/quotes/abc123...

GET /health

Health check: {"status": "ok", "service": "strfry-http"}

Architecture

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.

What's Different?

  • ✅ 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

Config Options

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

See Also

License

GPLv3 - Same as strfry

About

a nostr relay

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 64.4%
  • Go 28.0%
  • Perl 6.8%
  • Dockerfile 0.7%
  • Makefile 0.1%
  • C 0.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.