{"id":13832501,"url":"https://github.com/barkyq/gnost-relay","last_synced_at":"2025-07-09T19:30:30.305Z","repository":{"id":151205831,"uuid":"596349405","full_name":"barkyq/gnost-relay","owner":"barkyq","description":"nostr relay written in go","archived":false,"fork":false,"pushed_at":"2023-09-06T00:48:25.000Z","size":74,"stargazers_count":45,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-08-04T11:01:16.011Z","etag":null,"topics":["nostr"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barkyq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-02-02T01:36:04.000Z","updated_at":"2024-06-20T18:48:47.000Z","dependencies_parsed_at":"2024-01-13T16:27:49.564Z","dependency_job_id":"5f2473d2-4ea5-423b-9d0a-39617d807112","html_url":"https://github.com/barkyq/gnost-relay","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barkyq%2Fgnost-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barkyq%2Fgnost-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barkyq%2Fgnost-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barkyq%2Fgnost-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barkyq","download_url":"https://codeload.github.com/barkyq/gnost-relay/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225581774,"owners_count":17491788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nostr"],"created_at":"2024-08-04T11:00:21.311Z","updated_at":"2024-11-20T15:30:47.406Z","avatar_url":"https://github.com/barkyq.png","language":"Go","funding_links":[],"categories":["Install from Source","Relays"],"sub_categories":["Nostr","Implementations"],"readme":"# gnost-relay\nNostr relay written in go\n\n## Features\n- NIPs supported: [1][1], [9][9], [11][11], [12][12], [15][15], [16][16], [20][20], [26][26], [28][28], [33][33], [40][40], [42][42].\n- Websocket compression support (`permessage-deflate`), with support for client and server context takeover (i.e., sliding window support).\n- Hot config reloading. Edits to the `config.json` file will be instantly applied without requiring restart.\n- `--import` command line flag allows new events to be added via `stdin`. Events should be in `jsonl` format. Use in conjunction with [gnost-deflate-client][gnost-deflate-client]\n- Event handling logic happens via SQL triggers (i.e., NIPs [9][9], [16][16], [33][33], [40][40]).\n- New events are notified to listeners via postgresql's built in `pg_notify` feature. This implies that different instances of `gnost-relay` can be run concurrently. Indeed, any software which writes to the DB will automatically notify listeners connected to the relay.\n- Memory allocations are minimized using pools.\n- Token bucket style rate limiters for handling the messages are enabled on each websocket connection.\n\n## Example usage\n\n#### Running the relay\n```zsh\nDATABASE_URL=postgres://x gnost-relay --config config.json\n```\n#### Importing events\nWith `keepalive` set, the connection will remain open, and new events will be added to the `gnost-relay` database, and notified to any listeners. See [gnost-deflate-client][gnost-deflate-client] for more info.\n```zsh\necho '[{\"since\":1676863922,\"kinds\":[1]}]' |\\\ngnost-deflate-client --port 443 --scheme wss --host nos.lol --keepalive 30 --output - |\\\nDATABASE_URL=postgres://x gnost-relay --import\n```\n\n[1]: https://github.com/nostr-protocol/nips/blob/master/01.md\n[9]: https://github.com/nostr-protocol/nips/blob/master/09.md\n[11]: https://github.com/nostr-protocol/nips/blob/master/11.md\n[12]: https://github.com/nostr-protocol/nips/blob/master/12.md\n[15]: https://github.com/nostr-protocol/nips/blob/master/15.md\n[16]: https://github.com/nostr-protocol/nips/blob/master/16.md\n[20]: https://github.com/nostr-protocol/nips/blob/master/20.md\n[26]: https://github.com/nostr-protocol/nips/blob/master/26.md\n[28]: https://github.com/nostr-protocol/nips/blob/master/28.md\n[33]: https://github.com/nostr-protocol/nips/blob/master/33.md\n[40]: https://github.com/nostr-protocol/nips/blob/master/40.md\n[42]: https://github.com/nostr-protocol/nips/blob/master/42.md\n[gnost-deflate-client]: https://github.com/barkyq/gnost-deflate-client\n\n## Installation notes\n- Needs to have a `postgresql` database configured. The executable expects that the `DATABASE_URL` environment variable is set.\n- Should be run with a reverse proxy in front (e.g., NGINX).\n- See the [instructions](INSTALL.md) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarkyq%2Fgnost-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarkyq%2Fgnost-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarkyq%2Fgnost-relay/lists"}