A fresh implementation of the Nosflare Nostr relay, built using Hono and designed to run on Cloudflare Workers with R2 storage.
Honostr is a Nostr relay that leverages the performance and scalability of Cloudflare Workers and R2 object storage. This project is a reimagined version of Nosflare, rewritten using the Hono web framework to provide a lightweight and efficient solution for Nostr relay implementation.
- Cloudflare Workers Integration: Deploys easily to Cloudflare's edge network for low-latency communication.
- R2 Object Storage: Utilizes Cloudflare R2 for scalable and cost-effective data storage.
- Hono Framework: Built with Hono, a small, simple, and ultrafast web framework for Cloudflare Workers.
- Event Handling: Supports all standard Nostr event types and filters.
- Optimized Performance: Designed for high performance and minimal resource usage.
- Node.js (v16 or higher)
- Package Manager: npm, pnpm, or bun
- Cloudflare Account with Workers and R2 access
- Domain added to Cloudflare (optional, for domain-specific features)
-
Clone the Repository
git clone https://github.com/afxal/honostr.git cd honostr
-
Install Dependencies
npm install
or using pnpm
pnpm install
-
Configure Environment Variables
Create a
.env
file in the root of the project and add the following variables:AUTH_TOKEN=your_auth_token API_TOKEN=your_api_token ZONE_ID=your_zone_id R2_BUCKET_DOMAIN=your_r2_bucket_domain ACCOUNT_ID=your_account_id R2_BUCKET_NAME=your_bucket_name COMPATIBILITY_DATE=YYYY-MM-DD
Replace the placeholders with your actual Cloudflare credentials.
-
Build and Deploy
npm run build npm run deploy