Oddbean new post about | logout
β–² β–Ό
 GRAIN🌾 v0.2.0
πŸš€ New Features & Enhancements
- Config Management Revamp πŸ—‚οΈ:
  Special thanks nostr:npub1te0uzs6vj29umjaxlqqct82j8q6ppyefrxq06dhr8d6pvwfatgkqjmjgwp for the suggestion
  - Separate YAML Files for Blacklists and Whitelists: Moved the blacklist and whitelist configurations out of the main config.yml and into their own separate YAML files. This modular approach simplifies configuration management and makes it easier to update specific rules independently.

- Backup Relay Integration πŸ”—:
  - Backup Relay Support: Introduced a new feature to configure a backup relay. When enabled, Grain will send stored events to this backup relay after successfully storing them in the main database. This allows for seamless rebroadcasting to other personal relays or blaster relays, facilitating broader event dissemination.

- Enhanced Blacklist Capabilities πŸ”’:
  - Support for Nostr Mutelists: Introduced the ability to consider one or multiple pubkeys' nostr mutelists as blacklists. This allows the relay to dynamically block events based on mutelist data, adding another layer of event filtering.
  - NOTE: The mutelist event MUST first be stored in the grain database before it can be considered in the blacklist

- Timestamp-Based Event Rejection ⏱️:
  - Configurable Time Constraints: Added new configurations to reject events based on their created_at timestamps. The server can now be configured to reject events that are older or newer than specified, using either an integer (Unix timestamp) or a relative string format like "now+5m" for more flexibility.

πŸ› Bug Fixes
Special thanks nostr:npub1l5sga6xg72phsz5422ykujprejwud075ggrr3z2hwyrfgr7eylqstegx9z for the report
- Improved Duplicate Event Handling 🐞: 
  - Clearer Duplicate Event Responses: Fixed a bug that returned an ambiguous "could not connect to the database" error when receiving events already existing in the database. Now, the server returns a clearer response indicating that the event is a duplicate: "blocked: the database already contains this event."

πŸ› οΈ Other Changes
Code Refactoring πŸ› οΈ:
- Streamlined Whitelist Checks βœ”οΈ:
  - Refactored Whitelist Logic: Optimized the code for checking whitelists by removing redundant logic and integrating checks more efficiently. This enhances performance during event purging and handling, ensuring smoother operations and reduced code complexity.
  - General Code Clean-Up: Refactored the codebase to improve maintainability and readability. This includes streamlining various event handling paths and ensuring modular, reusable components across the application.

πŸ“¦ Installation Instructions
To install or update to version v0.2.0:
Just extract the app folder to the same directory as your executable, then run the program!

With these updates, v0.2.0 brings more robust event management, streamlined configuration handling, and enhanced support for relay integration.

https://github.com/0ceanSlim/grain/releases/tag/v0.2.0

I don't have a grant. Zaps ⚑  and Boots πŸ”  greatly appreciated for all my work. I do this because I πŸ’œ #nostr
#relay #grownostr #go