BTC

=

Loading price...

gold

=

Loading price...

🌾 G.R.A.I.N.

Go Relay Architecture for Implementing Nostr

A highly configurable Nostr relay implementation with a powerful Go client library and built-in web frontend for relay status and client features.

🌾 Try it Now: wss://wheat.happytavern.co

My public GRAIN instance is live! Connect your Nostr client and start using it today.

Storage Policy: This relay accepts any event and stores them for a set time before removal.

Want permanent storage? Get a Happy Tavern Membership for whitelist access!

Why GRAIN?

The key to GRAIN is being highly configurable to fit multiple use cases.

GRAIN was created because existing Nostr relay solutions didn't offer the flexibility needed for diverse deployment scenarios. At its core, GRAIN is a powerful, production-ready Nostr relay that you can configure to meet any needβ€”whether you're running a public relay, a private community relay, or a specialized relay with custom rules.

But GRAIN is more than just a relayβ€”it's also a comprehensive Go library for building all sorts of Nostr applications and tools. The client library handles connection pooling, event management, authentication, and more, so you can focus on building your application instead of reinventing the wheel.

🌾 GRAIN is Open Source

GRAIN is completely free and open source. You can run your own relay, customize it however you want, and contribute to the project. That's what GRAIN is all aboutβ€”giving you the freedom and tools to build on Nostr your way.

πŸ“‘

Nostr Relay

  • βœ“ Highly configurable via YAML settings
  • βœ“ MongoDB-backed event storage
  • βœ“ Advanced rate limiting & resource controls
  • βœ“ Whitelist/blacklist filtering
  • βœ“ Hot configuration reloading
  • βœ“ Event purging with retention policies
  • βœ“ NIP support: 1, 2, 9, 11, 40, 42, 65
πŸ“š

Go Client Library

  • βœ“ Connection pooling & relay management
  • βœ“ Event signing & broadcasting
  • βœ“ Subscription management with filters
  • βœ“ Key generation & conversion utilities
  • βœ“ Session-based authentication
  • βœ“ Perfect for building Nostr apps in Go
  • βœ“ Production-grade with error handling

Get Started with GRAIN

GRAIN is open source and built with ❀️ for the Nostr community. Contributions and feedback are always welcome!

πŸ–₯️ Built-in Web Frontend

Relay Dashboard

  • β€’ Real-time relay status
  • β€’ Configuration management
  • β€’ Connection monitoring
  • β€’ Hot-reload interface

Event & Profile Viewer

  • β€’ View user profiles
  • β€’ Display event details
  • β€’ Search functionality
  • β€’ Profile caching

Client Tools

  • β€’ Relay ping/latency testing
  • β€’ Key generation & conversion
  • β€’ Event publishing
  • β€’ Multiple auth methods

βš™οΈ Configuration Examples

GRAIN is designed for simplicity and flexibility. Customize settings to suit your requirements by editing the YAML configuration files.