Skip to main content
The Distributed Nodes and Control Plane architecture enables Palyra to operate as a federated system where a central daemon (palyrad) manages remote execution units (Nodes) and provides a unified administrative interface (Control Plane). This system is built on top of mTLS-secured gRPC communication and a capability-based access control model.

Node Runtime and mTLS RPC

Remote nodes connect to the Palyra daemon using a secure handshake process that establishes mutual TLS (mTLS) identities. The NodeRuntimeState in the daemon manages the lifecycle of these nodes, including their registration, capability discovery, and pairing requests.

Node Connectivity Architecture

The connection between a node and the daemon follows a strict security protocol:
  1. Pairing: A node initiates a pairing request using a PIN or QR code method crates/palyra-daemon/src/node_runtime.rs#24-30.
  2. Identity: The palyra-identity crate manages the Certificate Authority (CA) and issues device-specific certificates crates/palyra-daemon/src/node_runtime.rs#82-87.
  3. RPC: Communication occurs over gRPC (via node_rpc.rs), where the daemon dispatches capability requests to specific nodes based on their registered capabilities crates/palyra-daemon/src/node_runtime.rs#151-156.
Node System Mapping
Logic ComponentCode EntityFile Path
Node StateNodeRuntimeStatecrates/palyra-daemon/src/node_runtime.rs#177-182
Pairing RecordDevicePairingRequestRecordcrates/palyra-daemon/src/node_runtime.rs#106-121
Node RegistryRegisteredNodeRecordcrates/palyra-daemon/src/node_runtime.rs#130-138
mTLS StoreFilesystemSecretStorecrates/palyra-identity/src/store.rs#87-92
For details, see Node Runtime and mTLS RPC.

Control Plane Client

The palyra-control-plane crate provides the primary programmatic interface for interacting with a Palyra daemon. It abstracts the HTTP/gRPC transport layers and provides a type-safe ControlPlaneClient used by the CLI, Desktop app, and external integrations.

Client Capabilities

The ControlPlaneClient manages: Control Plane Integration Flow Sources: crates/palyra-control-plane/src/client.rs#33-38, crates/palyra-daemon/src/app/state.rs#29-59, crates/palyra-control-plane/src/models.rs#48-61 For details, see Control Plane Client.

Access Control Registry

The AccessRegistry is the central authority for permissions within the daemon. It manages feature flags, API tokens, and Role-Based Access Control (RBAC).

Compatibility Layer

The daemon includes a “Compat API” handler that allows external tools to use Palyra via OpenAI-compatible endpoints crates/palyra-daemon/src/transport/http/handlers/compat.rs#128-132. This layer enforces AccessRegistry permissions (e.g., compat.chat.create) before proxying requests to the internal orchestrator crates/palyra-daemon/src/transport/http/handlers/compat.rs#110-111. Access Control Mapping Sources: crates/palyra-daemon/src/access_control.rs#76-80, crates/palyra-daemon/src/access_control.rs#151-173, crates/palyra-daemon/src/access_control.rs#138-148, crates/palyra-daemon/src/access_control.rs#39-72

Node CLI Commands

The palyra CLI provides a dedicated command group for managing distributed nodes. Sources: crates/palyra-cli/src/commands/auth.rs#42-50, crates/palyra-cli/tests/daemon_status.rs#39-57

Child Pages