Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#817 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Priyanshubhartistm がすでに取り組んでいます。

2026年10月12日 から。

  • #818 @Priyanshubhartistm による — オープン

評価

この issue はまだ評価されていません。

説明

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

主要言語
TypeScript
スター
829
フォーク
234
平均マージ
2日 10時間
マージ済み PR(30日)
24

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cameri/nostream のほかの issue

cameri/nostream の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。