CyxWiz LogoCyxWiz
DocsDaemon

Daemon Mode

Run Server Node as a background service for continuous compute contribution.

Overview

Daemon mode runs the Server Node as a headless background service, ideal for:

  • Server deployments: No GUI required
  • 24/7 operation: Continuous compute availability
  • Remote management: Configure via API
  • Resource efficiency: Minimal overhead

Starting the Daemon

# Start daemon with default config
cyxwiz-server-node --daemon

# Start with custom config file
cyxwiz-server-node --daemon --config /path/to/config.toml

# Start with specific log level
RUST_LOG=info cyxwiz-server-node --daemon

Systemd Service (Linux)

Create a systemd service for automatic startup:

# /etc/systemd/system/cyxwiz-node.service
[Unit]
Description=CyxWiz Server Node
After=network.target

[Service]
Type=simple
User=cyxwiz
ExecStart=/usr/local/bin/cyxwiz-server-node --daemon
Restart=always
RestartSec=10
Environment=RUST_LOG=info

[Install]
WantedBy=multi-user.target
# Enable and start service
sudo systemctl daemon-reload
sudo systemctl enable cyxwiz-node
sudo systemctl start cyxwiz-node

# Check status
sudo systemctl status cyxwiz-node

# View logs
sudo journalctl -u cyxwiz-node -f

Windows Service

Register as a Windows service using NSSM:

# Install NSSM (Non-Sucking Service Manager)
choco install nssm

# Register service
nssm install CyxWizNode "C:\Program Files\CyxWiz\cyxwiz-server-node.exe"
nssm set CyxWizNode AppParameters "--daemon"
nssm set CyxWizNode AppDirectory "C:\Program Files\CyxWiz"

# Start service
nssm start CyxWizNode

# Or use sc.exe
sc create CyxWizNode binPath= "C:\Program Files\CyxWiz\cyxwiz-server-node.exe --daemon"

Daemon Configuration

# config.toml for daemon mode
[daemon]
pid_file = "/var/run/cyxwiz-node.pid"
log_file = "/var/log/cyxwiz-node.log"
log_rotation = "daily"
max_log_files = 7

[node]
name = "my-gpu-server"
wallet_address = "YOUR_SOLANA_WALLET"
max_concurrent_jobs = 3
auto_accept_jobs = true

[central_server]
address = "https://central.cyxwiz.com"
heartbeat_interval_ms = 30000
reconnect_delay_ms = 5000

[resources]
max_gpu_memory_percent = 90
max_cpu_percent = 80
reserved_system_memory_mb = 2048

Monitoring

Health Endpoint
# Check daemon health
curl http://localhost:8081/health

# Response
{
  "status": "healthy",
  "uptime_seconds": 86400,
  "active_jobs": 2,
  "gpu_usage": 75.5
}
Metrics Endpoint
# Get Prometheus metrics
curl http://localhost:8081/metrics

# cyxwiz_jobs_completed 156
# cyxwiz_jobs_failed 3
# cyxwiz_gpu_utilization 75.5
# cyxwiz_earnings_total 1234.56

Log Management

Log LevelDescriptionUse Case
errorErrors onlyProduction
warnWarnings and errorsProduction
infoGeneral informationDefault
debugDebug informationTroubleshooting
traceDetailed tracesDevelopment

Troubleshooting

Service Won't Start
Check permissions on config/log files, verify GPU drivers are installed, and ensure ports are not in use.
Connection Issues
Verify firewall rules allow outbound connections and check the central server address is correct.
High Memory Usage
Reduce max_concurrent_jobs and increase reserved_system_memory_mb in config.
Jobs Failing
Check GPU memory limits, review job logs, and ensure CUDA/OpenCL drivers are up to date.