{"id":13832498,"url":"https://github.com/denostr-lab/denostr","last_synced_at":"2025-07-09T19:30:29.566Z","repository":{"id":144126036,"uuid":"614267905","full_name":"denostr-lab/denostr","owner":"denostr-lab","description":"💪🏻 Rust-based, cloud-native Nostr relay derived from nostr-rs-relay.","archived":false,"fork":false,"pushed_at":"2024-01-24T06:15:36.000Z","size":2416,"stargazers_count":50,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-08-04T11:01:15.914Z","etag":null,"topics":["deno","nostr","nostr-relay"],"latest_commit_sha":null,"homepage":"https://denostr.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/denostr-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-03-15T08:42:51.000Z","updated_at":"2024-07-20T00:06:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"f35b278f-a4c5-489d-8421-239ae30b06d8","html_url":"https://github.com/denostr-lab/denostr","commit_stats":null,"previous_names":["denostr-protocol/denostr","denostr-lab/denostr","guakamoli/denostr"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denostr-lab%2Fdenostr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denostr-lab%2Fdenostr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denostr-lab%2Fdenostr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denostr-lab%2Fdenostr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denostr-lab","download_url":"https://codeload.github.com/denostr-lab/denostr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225581764,"owners_count":17491787,"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":["deno","nostr","nostr-relay"],"created_at":"2024-08-04T11:00:21.239Z","updated_at":"2024-11-20T15:30:44.987Z","avatar_url":"https://github.com/denostr-lab.png","language":"TypeScript","funding_links":[],"categories":["Relays"],"sub_categories":["Implementations"],"readme":"# [Denostr](https://github.com/denostr-lab/denostr)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"denostr logo\" height=\"256px\" width=\"256px\" src=\"https://user-images.githubusercontent.com/8678079/233816217-27504e7e-b429-4388-ac69-592122fa922b.png\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/denostr-lab/denostr/releases\"\u003e\n    \u003cimg alt=\"GitHub release\" src=\"https://img.shields.io/github/v/release/denostr-lab/denostr\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/denostr-lab/denostr/issues\"\u003e\n    \u003cimg alt=\"GitHub issues\" src=\"https://img.shields.io/github/issues/denostr-lab/denostr?style=plastic\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/denostr-lab/denostr/stargazers\"\u003e\n    \u003cimg alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/denostr-lab/denostr\" /\u003e\n  \u003c/a\u003e\n  \u003cimg alt=\"GitHub top language\" src=\"https://img.shields.io/github/languages/top/denostr-lab/denostr\"\u003e\n  \u003ca href=\"https://github.com/denostr-lab/denostr/network\"\u003e\n    \u003cimg alt=\"GitHub forks\" src=\"https://img.shields.io/github/forks/denostr-lab/denostr\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/denostr-lab/denostr/blob/main/LICENSE\"\u003e\n    \u003cimg alt=\"GitHub license\" src=\"https://img.shields.io/github/license/denostr-lab/denostr\" /\u003e\n  \u003c/a\u003e\n  \u003ca href='https://coveralls.io/github/denostr-lab/denostr?branch=main'\u003e\n    \u003cimg  alt='Coverage Status' src='https://coveralls.io/repos/github/denostr-lab/denostr/badge.svg?branch=main' /\u003e\n  \u003c/a\u003e\n  \u003ca href='https://github.com/denostr-lab/denostr/actions'\u003e\n    \u003cimg alt='Build status' src='https://github.com/denostr-lab/denostr/actions/workflows/checks.yml/badge.svg?branch=main\u0026event=push' /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n💪🏻 Deno-based, cloud-native Nostr relay forked from `nostream`.\n\nThis is a [nostr](https://github.com/fiatjaf/nostr) relay, written in Typescript.\n\nThis implementation is production-ready. See below for supported features.\n\nThe project main repository is available on [GitHub](https://github.com/denostr-lab/denostr).\n\n## Features\n\nNIPs with a relay-specific implementation are listed here.\n\n- [x] NIP-01: Basic protocol flow description\n- [x] NIP-02: Contact list and petnames\n- [x] NIP-04: Encrypted Direct Message\n- [ ] NIP-05: Mapping Nostr keys to DNS-based internet identifiers\n- [x] NIP-09: Event deletion\n- [x] NIP-11: Relay information document\n- [x] NIP-12: Generic tag queries\n- [x] NIP-13: Proof of Work\n- [x] NIP-15: End of Stored Events Notice\n- [x] NIP-16: Event Treatment\n- [x] NIP-20: Command Results\n- [x] NIP-22: Event `created_at` Limits\n- [x] NIP-26: Delegated Event Signing\n- [x] NIP-28: Public Chat\n- [x] NIP-33: Parameterized Replaceable Events\n- [x] NIP-38: [Encrypted Group Chat with Megolm group ratchet (Draft)](https://www.notion.so/NIP-38-Encrypted-Group-Chat-with-Megolm-group-ratchet-Draft-a4248bf444ff465daac1d992ecfdce24?pvs=4)\n- [x] NIP-40: Expiration Timestamp\n- [ ] NIP-42: Authentication of clients to relays\n- [ ] NIP-45: Event Counts\n\n## Architecture\n\nTodo\n\n## Requirements\n\n- Deno v1.30.x or v1.31.x\n- Typescript\n- MongoDB 4.4, 5.0, 6.0\n- Redis (Standalone Optional, Cluster Required)\n\n### kubernetes setups\n\n- v1.18.8 or later\n\n## Full Guide\n\n\u003e NOTE: If the payment is enabled, it is recommended to start another instance with `WORKER_TYPE=maintenance` following the \"Quick Start\" guide.\n\n### Accepting payments\n\n1. Before you begin\n   - Complete one of the Quick Start guides in this document\n   - Create a `.env` file\n   - On `.nostr/settings.yaml` file make the following changes:\n     - Set `payments.enabled` to `true`\n     - Set `payments.feeSchedules.admission.enabled` to `true`\n     - Set `limits.event.pubkey.minBalance` to the minimum balance in msats required to accept events (i.e. `1000000` to require a balance of `1000` sats)\n   - Choose one of the following payment processors: `lnbits`, `lnurl`, `zebedee`\n\n2. [LNbits](https://lnbits.com/)\n   - Complete the step \"Before you begin\"\n   - Create a new wallet on you public LNbits instance\n     - [Demo](https://legend.lnbits.com/) server must not be used for production\n     - Your instance must be accessible from the internet and have a valid SSL/TLS certificate\n   - Get wallet \"Invoice/read key\" (in Api docs section of your wallet)\n   - set `LNBITS_API_KEY` environment variable with the \"Invoice/read key\" Key above on your `.env` file\n\n     ```\n     LNBITS_API_KEY={YOUR_LNBITS_API_KEY_HERE}\n     ```\n   - On your `.nostr/settings.yaml` file make the following changes:\n     - Set `payments.processor` to `lnbits`\n     - set `lnbits.baseURL` to your LNbits instance URL (e.g. `https://{YOUR_LNBITS_DOMAIN_HERE}/`)\n     - Set `paymentsProcessors.lnbits.callbackBaseURL` to match your callbcak URL (e.g. `https://{YOUR_DOMAIN_HERE}/callbacks/lnbits`)\n   - Restart Denostr\n\n3. [Alby](https://getalby.com/) or any LNURL Provider with [LNURL-verify](https://github.com/lnurl/luds/issues/182) support\n   - Complete the step \"Before you begin\"\n   - [Create a new account](https://getalby.com/user/new) if you don't have an LNURL\n   - On your `.nostr/settings.yaml` file make the following changes:\n     - Set `payments.processor` to `lnurl`\n     - Set `lnurl.invoiceURL` to your LNURL (e.g. `https://getalby.com/lnurlp/your-username`)\n   - Restart Denostr\n\n4. [ZEBEDEE](https://zebedee.io)\n   - Complete the step \"Before you begin\"\n   - [Sign up for a ZEBEDEE Developer Dashboard account](https://dashboard.zebedee.io/signup), create a new LIVE Project, and get that Project's API Key\n   - Set `ZEBEDEE_API_KEY` environment variable with the API Key above on your `.env` file\n\n   ```\n   ZEBEDEE_API_KEY={YOUR_ZEBEDEE_API_KEY_HERE}\n   ```\n\n   - Follow the required steps for all payments processors\n   - On `.nostr/settings.yaml` file make the following changes:\n     - `payments.processor` to `zebedee`\n     - `paymentsProcessors.zebedee.callbackBaseURL` to match your callback URL (e.g. `https://{YOUR_DOMAIN_HERE}/callbacks/zebedee`)\n   - Restart Denostr\n\n5. Ensure payments are required for your public key\n   - Visit https://{YOUR-DOMAIN}/\n   - You should be presented with a form requesting an admission fee to be paid\n   - Fill out the form and take the necessary steps to pay the invoice\n   - Wait until the screen indicates that payment was received\n   - Add your relay URL to your favorite Nostr client (wss://{YOUR-DOMAIN}) and wait for it to connect\n   - Send a couple notes to test\n   - Go to https://websocketking.com/ and connect to your relay (wss://{YOUR_DOMAIN})\n   - Convert your npub to hexadecimal using a [Key Converter](https://damus.io/key/)\n   - Send the following JSON message: `[\"REQ\", \"payment-test\", {\"authors\":[\"your-pubkey-in-hexadecimal\"]}]`\n   - You should get back the few notes you sent earlier\n\n### Quick Start (Standalone)\n\nClone repository and enter directory:\n\n```sh\ngit clone https://github.com/denostr-lab/denostr.git --depth 1 \u0026\u0026 cd denostr\n```\n\nCreate `.env` file inside denostr project folder\n\nSet the following environment variables:\n\n```ini\nWORKER_TYPE=worker\nMONGO_URI=mongodb://user:pass@host:port/db?replicaSet=rs0\u0026authSource=admin\n```\n\nGenerate a long random secret and set SECRET:\n\nYou may want to use `openssl rand -hex 128` to generate a secret.\n\n```ini\nSECRET=aaabbbccc...dddeeefff\n# Secret shortened for brevity\n```\n\nIn addition, if using API Key for payments, You must also use the API key of each payment service to set the.\n\nCreate `.nostr` folder inside **denostr project folder** and copy over the settings file:\n\n```sh\nmkdir .nostr\ncp resources/default-settings.yaml .nostr/settings.yaml\n```\n\nTo start in development mode:\n\n```sh\ndeno task dev\n```\n\nOr, start in production mode:\n\n```sh\ndeno task start\n```\n\n### Apply for kubernetes\n\nPlease refer to [this document](./docs/apply-for-k8s.md)\n\n## Tests\n\n### Unit tests\n\nRun unit tests with:\n\n```sh\ndeno task test:unit\n```\n\n### Integration tests\n\nRun integration tests with:\n\n```sh\ndeno task test:integration\n```\n\n## Configuration\n\nYou can change the default folder by setting the `NOSTR_CONFIG_DIR` environment variable to a different path.\n\nRun denostr using one of the quick-start guides at least once and `denostr/.nostr/settings.json` will be created. Any changes made to the settings file will be read on the next start.\n\nDefault settings can be found under `resources/default-settings.yaml`. Feel free to copy it to `denostr/.nostr/settings.yaml` if you would like to have a settings file before running the relay first.\n\nSee [CONFIGURATION.md](CONFIGURATION.md) for a detailed explanation of each environment variable and setting.\n\n## Dev Channel\n\nFor development discussions, please use the [Nostr Typescript Relay Dev Group](https://t.me/denostr_dev).\n\nFor discussions about the protocol, please feel free to use the [Nostr Telegram Group](https://t.me/nostr_protocol).\n\n## License\n\nThis project is MIT licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenostr-lab%2Fdenostr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenostr-lab%2Fdenostr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenostr-lab%2Fdenostr/lists"}