百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

relayer

> 编程语言
开源

一个 Nostr 中继服务器框架。

343 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

一个 Nostr 中继服务器框架。

Nostr Relay Framework -- use it to implement your own custom relay.

There is an example/reference implementation at basic. Binaries for that are also available under Releases.

Supported NIPs

These are handled by the framework itself, so every relay built on it gets them:

NIP
01 Basic protocol flow (EVENT, REQ, CLOSE, EOSE, OK, CLOSED, NOTICE), including what used to be NIPs 12, 15, 16, 20 and 33
09 Event deletion request
11 Relay information document
67 EOSE completeness hint
77 Negentropy syncing (NEG-OPEN, NEG-MSG, NEG-CLOSE)

These depend on what your relay implements:

NIP requires
42 Auther — authentication of clients to relays
17, 59 Auther — gift-wrapped events are only served to the pubkey they are addressed to
45 a storage implementing EventCounter — COUNT

The default NIP-11 document reports exactly this set. A relay implementing Informationer replaces the document wholesale and is responsible for its own supported_nips.

Note that the numbers 12, 15, 16, 20 and 33 still appear in that document for the benefit of older clients; those NIPs were merged into NIP-01 and no longer exist on their own.

Running several instances on one storage

Live subscriptions are tracked in memory, so out of the box an event published to one instance is only pushed to the clients of that instance. To run several instances (behind a load balancer, say) against one shared storage, implement Notifier on your relay or on your storage:

go
type Notifier interface {
	Notify(context.Context, *nostr.Event) error
	Notifications(context.Context) (<-chan *nostr.Event, error)
}

Notify is called for every accepted event; Notifications must deliver the events accepted by every instance, this one included. With a Notifier present, events reach local subscribers only through Notifications, so there is a single delivery path and no duplicates.

Notifier is eventstore.Notifier, and the postgresql storage implements it with LISTEN/NOTIFY, so a relay on PostgreSQL gets this for free. For any other storage the transport is up to you — Redis pub/sub, NATS, anything that carries events from Notify on one instance to Notifications on all of them; see multi-instance for SQLite kept in sync over Redis.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Gonostrrelay

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言