Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

feat(nip77): NEG-OPEN/NEG-MSG/NEG-CLOSE wire protocol for the PostgreSQL backend

Đang mở
#817 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Priyanshubhartistm đang làm issue này rồi.

Từ ngày 12/10/2026.

  • #818 của @Priyanshubhartistm — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

enhancement

Is your feature request related to a problem? Please describe.
The negentropy reconciliation core and the sorted event id query landed in #809 (issue #801), but nothing calls them yet, so relays still cannot answer NIP-77 sync requests. Clients and relay-to-relay syncers keep catching up with wide REQ filters and receive every matching event.

Describe the solution you'd like
Expose the core over the websocket as described in NIP-77, for the PostgreSQL event store only:

  • Parse and validate NEG-OPEN (subscription id, a single filter, hex initial message), NEG-MSG and NEG-CLOSE, and send NEG-MSG and NEG-ERR replies. NEG-OPEN for an id that is already open closes the old session first, and ids live in a separate namespace from REQ ids.
  • Keep per-connection session state and free it on NEG-CLOSE, NEG-ERR, idle timeout and disconnect.
  • Bound resource use, since each session holds the whole matching (created_at, id) set in memory: a maximum number of events per session (rejected with NEG-ERR blocked:), a maximum number of concurrent sessions per connection, and an idle timeout (NEG-ERR closed:).
  • Apply the same NIP-42 restricted-kind checks and filter limits that COUNT applies.
  • Add a nip77 settings section with enabled (default false, so merging this changes nothing for existing relays) and the limits above, documented in CONFIGURATION.md. The feature only responds when nip77.enabled is true and eventStore.backend is postgres, so it stays out of the way of alternative backends that implement negentropy themselves.
  • Remove the temporary .knip.json ignore entry added with the core.
  • Tests for message validation, session lifecycle, limits, and a full client-to-relay reconciliation over the handlers.

Out of scope, tracked separately: advertising NIP-77 in NIP-11 supported_nips, and the admin console settings schema.

Additional context

Ngôn ngữ chính
TypeScript
Star
829
Fork
234
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
24

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cameri/nostream

Tất cả issue của cameri/nostream

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.