{"id":13832762,"url":"https://github.com/MutinyWallet/blastr","last_synced_at":"2025-07-09T19:31:11.186Z","repository":{"id":91148622,"uuid":"603264643","full_name":"MutinyWallet/blastr","owner":"MutinyWallet","description":"A nostr cloudflare workers proxy relay that publishes to all known relays","archived":false,"fork":false,"pushed_at":"2024-01-26T00:09:56.000Z","size":171,"stargazers_count":122,"open_issues_count":0,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-02-17T05:34:15.146Z","etag":null,"topics":["cloudflare","nostr","proxy","relay","rust","wasm"],"latest_commit_sha":null,"homepage":"wss://nostr.mutinywallet.com","language":"Rust","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/MutinyWallet.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-18T01:26:09.000Z","updated_at":"2024-05-29T23:55:40.084Z","dependencies_parsed_at":"2024-01-13T16:30:55.932Z","dependency_job_id":"59f7f7db-c0cd-4980-af97-dff142c83441","html_url":"https://github.com/MutinyWallet/blastr","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/MutinyWallet%2Fblastr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MutinyWallet%2Fblastr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MutinyWallet%2Fblastr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MutinyWallet%2Fblastr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MutinyWallet","download_url":"https://codeload.github.com/MutinyWallet/blastr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225581833,"owners_count":17491794,"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":["cloudflare","nostr","proxy","relay","rust","wasm"],"created_at":"2024-08-04T11:00:30.061Z","updated_at":"2024-11-20T15:31:04.588Z","avatar_url":"https://github.com/MutinyWallet.png","language":"Rust","funding_links":[],"categories":["Install from Source","Relays","Rust"],"sub_categories":["Nostr","Implementations"],"readme":"# blastr\n\nA nostr cloudflare workers proxy relay that publishes to all known online relays.\n\n![blastr diagram](./docs/images/blastr-diagram.png)\n\nThis takes advantage of the high availabilty of cloudflare serverless workers on the edge that are rust wasm-based with 0ms cold starts. Learn more about [cloudflare workers](https://workers.cloudflare.com/).\n\nThis is write only for now and is compatible with nostr clients but also features a simple POST api endpoint at `/event`. All events get queued up to run in batches by another worker that spins up every 30s if there's any events lined up, or once a certain amount of events are queued up.\n\nThis will help ensure that your events are broadcasted to as many places as possible.\n\n## Development\n\nWith `wrangler`, you can build, test, and deploy your Worker with the following commands:\n\n```sh\n# install wrangler if you do not have it yet\n$ npm install -g wrangler\n\n# log into cloudflare if you havent before\n$ wrangler login\n\n# compiles your project to WebAssembly and will warn of any issues\n$ npm run build\n\n# run your Worker in an ideal development workflow (with a local server, file watcher \u0026 more)\n$ npm run dev\n\n# deploy your Worker globally to the Cloudflare network (update your wrangler.toml file for configuration)\n$ npm run deploy\n```\n\n## Staging\n\nProduction deployments happen automatically but staging is manually for now. Deploy whenever you need to test changes before merging to master.\n\n```\nwrangler publish --env staging\n```\n\n### Setup\n\nThere's a few cloudflare components that Blastr uses behind the scenes, namely a KV store and multiple queues to distribute the load.\n\nRight now some of these are hardcoded for us since they have to map from the `wrangler.toml` file to the rust codebase. Need a TODO for making this more dynamic.\n\n#### KV store\n\nThis doesn't rebroadcast events that have already been broadcasted before. So we have a KV for that.\n\nWe also have a KV for storing the NWC requests and responses to get around ephemeral events.\n\n```\nwrangler kv:namespace create PUBLISHED_NOTES\nwrangler kv:namespace create PUBLISHED_NOTES --preview\n\nwrangler kv:namespace create NWC_REQUESTS\nwrangler kv:namespace create NWC_REQUESTS --preview\n\nwrangler kv:namespace create NWC_RESPONSES\nwrangler kv:namespace create NWC_RESPONSES --preview\n```\n\n#### Queues\n\n```\n wrangler queues create nostr-events-pub-1-b\n wrangler queues create nostr-events-pub-2-b\n wrangler queues create nostr-events-pub-3-b\n wrangler queues create nostr-events-pub-4-b\n wrangler queues create nostr-events-pub-5-b\n wrangler queues create nostr-events-pub-6-b\n wrangler queues create nostr-events-pub-7-b\n wrangler queues create nostr-events-pub-8-b\n wrangler queues create nostr-events-pub-9-b\n wrangler queues create nostr-events-pub-10-b\n```\n\nRead the latest `worker` crate documentation here: https://docs.rs/worker\n\n### CICD\n\nThere's an example workflow here for publishing on master branch pushes. You need to set `CF_API_TOKEN` in your github repo secrets first.\n\nYou also should either remove or configure `wrangler.toml` to point to a custom domain of yours:\n\n```\nroutes = [\n    { pattern = \"example.com/about\", zone_id = \"\u003cYOUR_ZONE_ID\u003e\" } # replace with your info\n]\n```\n\nand any other info in `wrangler.toml` that is custom to you, like the names / id's of queues or kv's.\n\n### WebAssembly\n\n`workers-rs` (the Rust SDK for Cloudflare Workers used in this template) is meant to be executed as compiled WebAssembly, and as such so **must** all the code you write and depend upon. All crates and modules used in Rust-based Workers projects have to compile to the `wasm32-unknown-unknown` triple.\n\nRead more about this on the [`workers-rs`](https://github.com/cloudflare/workers-rs) project README.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMutinyWallet%2Fblastr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMutinyWallet%2Fblastr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMutinyWallet%2Fblastr/lists"}