Components

Styrene consists of two main components: styrened (daemon + library + TUI in one package) and infrastructure-as-code for edge devices.

styrened

Unified daemon, shared library, and TUI for the Styrene mesh. The TUI is bundled as a subpackage (styrened.tui), installed via the [tui] extra.

StatusAlpha
DependenciesRNS, LXMF, PyYAML, SQLAlchemy, msgpack
TUI FrameworkTextual 8.0
Tests~3,844+ (unit, TUI, mesh, bare-metal)
ThemeImperial CRT (green phosphor terminal)

Installation

pipx install styrene                    # Recommended (daemon + TUI, isolated env)
pip install styrened                    # Daemon + library only (no TUI, for edge devices)
nix run github:styrene-lab/styrened     # Nix flake

Entry Points

CommandPurpose
styreneLaunch TUI (styrene --upgrade to self-update)
styrenedDaemon CLI (headless)

As Daemon (runs on edge devices)

  • RPCServer — fleet management commands
  • AutoReplyHandler — responds to NomadNet/MeshChat users
  • LXMFService — messaging with optional propagation node mode
  • Device Discovery + NodeStore — persistent mesh topology
  • TerminalService — remote shell via PTY over RNS Link
  • IPC Control Server — Unix socket for local CLI/TUI
  • HTTP API — optional REST endpoints

As TUI (operator interface)

The TUI (styrened.tui) is a Textual-based terminal application using the Imperial CRT theme.

Screens:

  • Dashboard — Fleet overview with mesh device table, activity feed
  • Chat — Encrypted LXMF conversations with delivery tracking
  • Device Detail — Mesh node info, actions (Message, Add Contact, Copy Hash)
  • Settings — Tabbed: Identity, Network, Fleet, System
  • Exploration — Non-Styrene RNS announces
  • Upgrade — In-app self-update with live progress
  • First-Run Wizard — Initial setup and daemon connection

Network Settings (7 panels):

  • STYRENE COMMUNITY HUB — Single toggle (default ON), controls both transport peer and LXMF propagation destination
  • TRANSPORT — Mode, transport toggle, announce interval
  • PEERS — Dynamic add/remove of RNS transport peers
  • PROPAGATION — LXMF propagation destination hash (auto-synced with community hub toggle, accepts custom 32-char hex)
  • LOCAL DISCOVERY — AutoInterface toggle
  • SERVER — Server interface (IP/port)
  • BATMAN-ADV MESH — mesh_id, channel, gateway_mode

As Library

  • RPC client/server implementations
  • Wire protocol v2 encoding/decoding
  • Message models and data structures
  • Service lifecycle management (LXMFService, ConfigService, NodeStore)
  • Device discovery and conversation services

Community Hub Integration

New installs default to the Styrene Community Hub (rns.styrene.io:4242):

  • RNS transport peer for announce relay
  • LXMF propagation destination for store-and-forward messaging
  • COMMUNITY_HUB_PROPAGATION_HASH constant in models/config.py
  • OPERATOR profile defaults set this as lxmf.propagation_destination

Theme: Imperial CRT

┌─ Imperial CRT Phosphor Palette ──────────────────────────┐
│  Bright:  #39ff14  Active elements, highlights, success  │
│  Medium:  #32cd32  Standard text, borders                │
│  Dim:     #228b22  Secondary text, inactive elements     │
│  Dark:    #1a5c1a  Subtle borders, separators            │
│  Background: #0a0a0a                                     │
└──────────────────────────────────────────────────────────┘

NixOS Integration

{
  imports = [ ../common/styrened.nix ];
  styrene.daemon.enable = true;
}

styrene-edge

Infrastructure-as-code and provisioning toolchain for the hardware fleet.

StatusProduction
FormatNix configurations + Python (Forge)

Active Devices

DeviceArchBootMedia
MiniGMK (x86-generic)x86_64UEFI 64USB installer
Q502L (x86-generic)x86_64UEFI 64USB installer
T100TAx86_64UEFI 32USB installer
Raspberry Pi 4aarch64U-BootDirect SD
Raspberry Pi Zero 2Waarch64U-BootDirect SD
RG35XX Haarch64U-BootDirect SD
R36Saarch64U-BootDirect SD

Usage

# Build SD card image for RPi 4 (fetches from Cachix)
nix build ./sbc#packages.aarch64-linux.rpi4-sd

# Launch Forge TUI for USB media preparation
just run

# Run polymerize.sh on target device after booting USB
sudo /iso/styrene/polymerize.sh

Structure

styrene-edge/
├── sbc/
│   ├── flake.nix               # Nix flake for SD card images
│   ├── common/
│   │   ├── base.nix            # styrene.base NixOS module (shared config)
│   │   ├── batman-mesh.nix     # styrene.mesh BATMAN-adv module
│   │   ├── styrened.nix        # styrene.daemon module
│   │   └── cosmic-desktop.nix  # styrene.desktop COSMIC DE module
│   ├── rpi4/configuration.nix
│   ├── rpi-zero2w/configuration.nix
│   ├── x86-generic/
│   │   ├── configuration.nix
│   │   └── polymerize.sh       # NixOS installer for UEFI x86
│   └── t100ta/
│       ├── configuration.nix
│       └── polymerize.sh       # NixOS installer for 32-bit UEFI
├── firmware/                    # Upstream firmware manifests
│   ├── sources.yaml            # Pinned releases (version + sha256)
│   └── fetch.sh                # Download and verify pinned artifacts
├── forge/                      # Styrene Forge (media prep TUI)
│   ├── data/devices.yaml       # Device catalog
│   └── services/
│       ├── media_writer.py     # USB/SD media writer
│       └── bundle_builder.py   # Config bundler
├── installs/                   # Runbook tracking
├── keys/                       # Builder SSH keys (public only in git)
├── mcu/                        # Microcontrollers (RP2040, ESP32, nRF)
└── router/                     # OpenWrt mesh routers

styrene-rs

Rust parallel implementation of the RNS/LXMF stack, forked from FreeTAKTeam/LXMF-rs. Shares the wire protocol contract with Python styrened — no FFI, no shared memory.

StatusPhase 1 (Fork and Foundation)
Repostyrene-lab/styrene-rs
UpstreamFreeTAKTeam/LXMF-rs

Crate Inventory

CratePurpose
styrene-rnsRNS protocol core — identity, destinations, links, resources, ratchets
styrene-rns-transportTransport interfaces — TCP, UDP, future Serial/KISS
styrene-lxmfLXMF messaging — router, propagation, stamps, delivery pipeline
styrene-meshStyrene wire protocol envelope matching styrene_wire.py
styreneMeta-crate re-exporting all library crates
styrened-rsDaemon binary (skeleton — active development after interop gate)
interop-testCross-implementation test harness with Python-generated fixtures

Migration Strategy

Python remains primary until Rust passes the interop gate. See rust-migration for the 5-phase plan.


Relationship Diagram

Component relationships

See Also

Graph