Lattice Setup & Configuration
This guide covers all configuration options for Station Lattice, including config file setup, environment variables, TLS encryption, and NKey authentication.Configuration Methods
Station Lattice can be configured through:- CLI flags (highest priority)
- Environment variables
- Config file (
config.yaml)
Config File
Add alattice section to your config.yaml:
config.yaml
Environment Variables
All lattice settings can be configured via environment variables:| Variable | Description | Default |
|---|---|---|
STN_LATTICE_MODE | orchestrator or member | - |
STN_LATTICE_STATION_ID | Unique station identifier | auto-generated |
STN_LATTICE_STATION_NAME | Human-readable name | hostname |
STN_LATTICE_NATS_URLS | Comma-separated NATS URLs | - |
STN_LATTICE_NATS_PORT | Embedded NATS port | 4222 |
STN_LATTICE_HEARTBEAT_INTERVAL | Heartbeat frequency | 5s |
STN_LATTICE_TLS_ENABLED | Enable TLS | false |
STN_LATTICE_TLS_CERT | TLS certificate path | - |
STN_LATTICE_TLS_KEY | TLS key path | - |
STN_LATTICE_TLS_CA | TLS CA certificate path | - |
STN_LATTICE_NKEY_SEED | NKey seed file path | - |
CLI Flags
Orchestrator Configuration
Basic Setup
orchestrator-config.yaml
JetStream Storage
The orchestrator uses JetStream for persistent storage:Cluster Mode (High Availability)
For production deployments, run multiple orchestrators in cluster mode:orchestrator-1.yaml
Member Configuration
Basic Setup
member-config.yaml
Multiple NATS URLs (Failover)
Reconnection Settings
Security Configuration
TLS Encryption
Generate certificates for secure communication:orchestrator-config.yaml
member-config.yaml
NKey Authentication
NKeys provide secure, passwordless authentication using Ed25519 keys. Generate NKey pairs:orchestrator-config.yaml
member-config.yaml
Agent Configuration
Declaring Capabilities
Agents can declare capabilities for routing:agent.yaml
Restricting Remote Access
Control which agents can be invoked remotely:config.yaml
Monitoring
Health Endpoints
The lattice exposes health information:Metrics
Lattice exposes Prometheus metrics:Troubleshooting
Connection Issues
Common Errors
| Error | Cause | Solution |
|---|---|---|
connection refused | NATS not running | Start orchestrator first |
authorization violation | Invalid NKey | Check seed file and authorized users |
certificate verify failed | TLS mismatch | Verify CA chain matches |
station not found | Not registered | Check heartbeat interval |

