Go Relay Architecture for Implementing Nostr 🌾
Go to file
2024-07-31 11:28:41 -04:00
config removed redundancies 2024-07-31 11:28:41 -04:00
relay removed redundancies 2024-07-31 11:28:41 -04:00
tests configuration refactor 2024-07-30 11:27:38 -04:00
web refactor more main funcs 2024-07-30 11:51:05 -04:00
.gitignore hotfix 2024-07-28 09:41:10 -04:00
config.example.yml event size limits 2024-07-26 16:46:01 -04:00
go.mod added ws close on error 2024-07-30 09:31:26 -04:00
go.sum added ws close on error 2024-07-30 09:31:26 -04:00
license first commit 2024-07-19 18:07:04 -04:00
main.go removed redundancies 2024-07-31 11:28:41 -04:00
readme.md NIP11 implemented (relay metadata) 2024-07-27 16:46:25 -04:00
relay_metadata.example.json NIP11 implemented (relay metadata) 2024-07-27 16:46:25 -04:00

GRAIN 🌾

Go Relay Archetecture for Implementing Nostr

GRAIN is an open-source Nostr relay implementation written in Go. This project aims to provide a robust and efficient Nostr relay that currently supports the NIP-01 of the nostr protocol.

Features

  • NIP-01 Protocol Support: GRAIN (nearly)fully supports NIP-01 for WebSocket communication.
  • Event Processing: Handles all events by category and kind.
  • MongoDB 🍃: Utilizes MongoDB to store and manage events efficiently.
  • Scalability: Built with Go, ensuring high performance and scalability.
  • Open Source: Licensed under the MIT License, making it free to use and modify.

Configuration

Configuration options can be set through a configuration file.

There is an example config in this repo. Copy the example config to config.yml to get started

cp config.example.yml config.yml

Additionally, you may set metadata Information for your relay with relay_matadata.json

cp relay_metadata.example.json relay_metadata.json

TODO

  • configurable event purging
    • by category
    • by kind
    • by time since latest
  • create whitelist/blacklist functionality for:
    • valid nip05 domain
    • pubkey
    • npub
    • kind int
    • kind 1 wordlist

Development

To contribute to GRAIN, follow these steps:

  1. Fork the repository.

  2. Make your changes.

  3. Commit your changes:

    git commit -m "Description of changes"
    
  4. Push to the repo:

    git push
    
  5. Create a Pull Request.

License

This project is Open Source and licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

Special thanks to the Nostr community for their continuous support and contributions.

Feel free to reach out with any questions or issues you encounter while using GRAIN. Happy coding!