Add daemon mode (rnsd) - A Rust alternative to Python Reticulum's daemon
#57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds daemon functionality to reticulum-rs, making it possible to run a standalone Reticulum node configured through standard TOML files. I've been running this as my transport node for the past three weeks without issues.
What works right now
The daemon reads Python Reticulum-style configuration files (after conversion) and initializes TCP and UDP interfaces. I can confirm TCPClient, TCPServer, and UDPInterface all work reliably in production. The other interface types (AutoInterface, I2PInterface, RNodeInterface, etc.) parse correctly but log warnings since they're not implemented yet.
The configuration format problem
Python Reticulum's config format isn't actually valid TOML, even though it looks like it should be. It uses syntax like
[[Interface Name]]with spaces, writesYes/Noinstead oftrue/false, and leaves string values unquoted. Standard TOML parsers reject this, which is why I've included a converter tool.If you have an existing
.reticulum/configfile, you'll need to convert it first:cargo run --example convert_config -- ~/.reticulum/configThis creates a backup and rewrites your config in valid TOML. It preserves all your settings and comments, just fixes the syntax. The converted format looks like:
How it finds your config
The daemon searches in this order:
~/.config/reticulum,~/.reticulum,/etc/reticulum. This follows XDG conventions and makes it easier for distro packagers to provide system-wide defaults in/etcwhile users can override with their own configs.If no config exists, it creates a minimal one at
~/.config/reticulum/config.tomlwith a TCP server on localhost:4242.Open questions
Which options should the Kanoic Interface have?
Several design decisions came up during implementation that would benefit from community input. I've opened separate issues to keep discussion focused:
.tomlfile extension #60None of these block the current functionality, but feedback would help guide future work.
Testing
Beyond my own three-week run as a transport node, I've verified the conversion works with configs from
rnsd --exampleconfigand tested that all three implemented interface types work as expected. The daemon handles interface failures gracefully and logs at appropriate levels.This is a significant milestone since it makes reticulum-rs usable as a drop-in replacement for the Python daemon in real deployments. Looking forward to feedback and suggestions.