fiatjaf 4ce75ecc78
Some checks failed
build cli / make-release (push) Has been cancelled
build cli / build-linux (push) Has been cancelled
limit index scans to the maximum of total returnable events.
2024-04-16 17:25:59 -03:00
2024-02-08 12:36:54 -03:00
2023-11-09 13:31:24 -03:00
2024-01-30 14:42:57 +09:00
2024-03-24 19:18:32 +09:00
2024-01-14 22:24:34 -03:00
2024-02-22 09:33:14 +09:00
2024-02-08 12:36:54 -03:00
2023-10-31 16:01:30 -03:00
2024-03-30 20:19:30 -03:00
2024-03-30 20:19:30 -03:00
2023-11-07 09:15:39 -03:00

eventstore

A collection of reusable database connectors, wrappers and schemas that store Nostr events and expose a simple Go interface:

type Store interface {
	// Init is called at the very beginning by [Server.Start], after [Relay.Init],
	// allowing a storage to initialize its internal resources.
	Init() error

	// Close must be called after you're done using the store, to free up resources and so on.
	Close()

	// QueryEvents is invoked upon a client's REQ as described in NIP-01.
	// it should return a channel with the events as they're recovered from a database.
	// the channel should be closed after the events are all delivered.
	QueryEvents(context.Context, nostr.Filter) (chan *nostr.Event, error)

	// DeleteEvent is used to handle deletion events, as per NIP-09.
	DeleteEvent(context.Context, *nostr.Event) error

	// SaveEvent is called once Relay.AcceptEvent reports true.
	SaveEvent(context.Context, *nostr.Event) error
}

Go Reference

command-line tool

There is an eventstore command-line tool that can be used to query these databases directly.

Description
eventstore
Readme 348 KiB
Languages
Go 100%