OceanSlim on Nostr: gm 🌞 New Grain Release, finally. 🌾 Appreciate any support I receive! ...
gm 🌞 New Grain Release, finally. 🌾 Appreciate any support I receive!
https://github.com/0ceanSlim/grain/releases/tag/v0.3.0
🚀 New Features & Enhancements
Nostr Login & Profile Page 🔑
- Introduced Nostr login to the front end, allowing users to authenticate using their Nostr key.
- After login, users are taken to a profile page that displays their Kind 0 metadata (if stored on the relay).
- Future updates will add more front-end functionality, including event management, delete requests, relay configuration for operators, and a dashboard with relay statistics.
User Sync (Experimental) 🔁
- New user sync functionality allows the relay to sync events for its users from their outboxes.
- How it works:
- When a user posts an event, the relay checks if they are new and starts a sync process.
- Sync runs on an interval, on startup, and when a new user joins.
- First, the relay REQs itself for the user’s outboxes.
- If not found, it searches configured initial relays for outbox data, stores the user’s outboxes, and requests the
events configured for sync from the users outboxes.
- The relay then compares stored vs missing events and attempts to store the missing ones in batches at half the configured rate limit.
- Configurable Sync Options:
- Define which event kinds to sync (e.g., only Kind 0, 3, and 1)
- Define a limit of how many events to retrieve
- Exclude non-whitelisted users from sync—if enabled, only users explicitly in your whitelist (key, npub, or
whitelisted domain) will be synced.
- Limitations:
- While the process works, it may not retrieve all events immediately and sometimes attempts to store
duplicates.
- A patch will be released soon to allow disabling the initial sync on startup.
- Enhanced logging coming in the next update to improve debugging and tracking of sync behavior.
🐛 Bug Fixes
Live Config Reloading 🔃
- No more manual restarts! The relay now automatically reloads its configuration when changes are detected.
- Fixes a long-standing issue where changes to config.yml required a full restart before taking effect.
- This lays the groundwork for a future admin control panel.
WebSocket Client Handling Overhaul 🌐
- One reader/writer per client—fixes previous race conditions where multiple readers and writers conflicted with the same connected client.
- Ensures more reliable request handling and event processing.
- Fixed fragmented event assembly—relay now properly handles long events split across multiple messages before passing them to the handler.
🛠️ Other Changes
Database Improvements 📦
- Users can now configure the database name instead of being locked to the default "grain".
- This allows running multiple Grain relays with different configs while using the same MongoDB backend (each relay can store data separately).
- MongoDB indexes created for:
- pubkey
- created_at
- kind
- id
- Future updates will include tag indexing for single-letter tags.
Refactoring
- Renamed all instances of parameterized replaceable event to correctly read the addressable event.
- Removed manual max goroutine configuration—now dynamically managed based on heap, CPU cores, and memory usage.
📦 Installation Instructions
To install or update to version v0.3.0:
Just extract the app folder to the same directory as your executable, then run the program!
Upgrading
- If you're upgrading, please take a look at the new example configs. Change your configs accordingly and replace the old executable and app directory with the new one.
💡 What's Next?
The next release will focus on logging and debugging—enhancing error reporting, tracking user sync more effectively, and optimizing the entire relay process.
Thanks for your patience on this release! Most of the work is done by a single dev, so feedback and testing are always appreciated. 🚀
New Contributors
fix: small bugs. by K (npub1h49…9kay) in #33
https://github.com/0ceanSlim/grain/releases/tag/v0.3.0
🚀 New Features & Enhancements
Nostr Login & Profile Page 🔑
- Introduced Nostr login to the front end, allowing users to authenticate using their Nostr key.
- After login, users are taken to a profile page that displays their Kind 0 metadata (if stored on the relay).
- Future updates will add more front-end functionality, including event management, delete requests, relay configuration for operators, and a dashboard with relay statistics.
User Sync (Experimental) 🔁
- New user sync functionality allows the relay to sync events for its users from their outboxes.
- How it works:
- When a user posts an event, the relay checks if they are new and starts a sync process.
- Sync runs on an interval, on startup, and when a new user joins.
- First, the relay REQs itself for the user’s outboxes.
- If not found, it searches configured initial relays for outbox data, stores the user’s outboxes, and requests the
events configured for sync from the users outboxes.
- The relay then compares stored vs missing events and attempts to store the missing ones in batches at half the configured rate limit.
- Configurable Sync Options:
- Define which event kinds to sync (e.g., only Kind 0, 3, and 1)
- Define a limit of how many events to retrieve
- Exclude non-whitelisted users from sync—if enabled, only users explicitly in your whitelist (key, npub, or
whitelisted domain) will be synced.
- Limitations:
- While the process works, it may not retrieve all events immediately and sometimes attempts to store
duplicates.
- A patch will be released soon to allow disabling the initial sync on startup.
- Enhanced logging coming in the next update to improve debugging and tracking of sync behavior.
🐛 Bug Fixes
Live Config Reloading 🔃
- No more manual restarts! The relay now automatically reloads its configuration when changes are detected.
- Fixes a long-standing issue where changes to config.yml required a full restart before taking effect.
- This lays the groundwork for a future admin control panel.
WebSocket Client Handling Overhaul 🌐
- One reader/writer per client—fixes previous race conditions where multiple readers and writers conflicted with the same connected client.
- Ensures more reliable request handling and event processing.
- Fixed fragmented event assembly—relay now properly handles long events split across multiple messages before passing them to the handler.
🛠️ Other Changes
Database Improvements 📦
- Users can now configure the database name instead of being locked to the default "grain".
- This allows running multiple Grain relays with different configs while using the same MongoDB backend (each relay can store data separately).
- MongoDB indexes created for:
- pubkey
- created_at
- kind
- id
- Future updates will include tag indexing for single-letter tags.
Refactoring
- Renamed all instances of parameterized replaceable event to correctly read the addressable event.
- Removed manual max goroutine configuration—now dynamically managed based on heap, CPU cores, and memory usage.
📦 Installation Instructions
To install or update to version v0.3.0:
Just extract the app folder to the same directory as your executable, then run the program!
Upgrading
- If you're upgrading, please take a look at the new example configs. Change your configs accordingly and replace the old executable and app directory with the new one.
💡 What's Next?
The next release will focus on logging and debugging—enhancing error reporting, tracking user sync more effectively, and optimizing the entire relay process.
Thanks for your patience on this release! Most of the work is done by a single dev, so feedback and testing are always appreciated. 🚀
New Contributors
fix: small bugs. by K (npub1h49…9kay) in #33