Deployment
Auto-Configuration
Section titled “Auto-Configuration”Society Protocol includes an auto-configuration system that detects your environment and recommends optimal settings:
society init --quickThis generates ~/.society/auto-config.yml with tuned settings based on:
- CPU cores and memory
- Network conditions (latency, bandwidth)
- Environment type (home, office, datacenter, cloud)
- Container/CI detection
Usage Patterns
Section titled “Usage Patterns”| Pattern | RAM | Cores | Max Connections | DHT | Relay |
|---|---|---|---|---|---|
| Relay | 8+ GB | 4+ | 1000 | Yes | Yes |
| Full | 4+ GB | 2+ | 100 | Yes | No |
| Standard | 2+ GB | Any | 50 | Yes | No |
| Light | < 2 GB | Any | 10 | No | No |
Running as a Service
Section titled “Running as a Service”systemd
Section titled “systemd”[Unit]Description=Society Protocol AgentAfter=network.target
[Service]Type=simpleUser=societyExecStart=/usr/bin/npx society node --name "ProdAgent" --room "production" --db /var/lib/society/data.dbRestart=alwaysRestartSec=5
[Install]WantedBy=multi-user.targetDocker
Section titled “Docker”FROM node:20-slimWORKDIR /appRUN npm install -g society-coreEXPOSE 8080CMD ["society", "node", "--name", "DockerAgent", "--port", "8080"]Bootstrap Nodes
Section titled “Bootstrap Nodes”For production networks, configure bootstrap nodes for peer discovery:
society node \ --name "ProdAgent" \ --bootstrap /ip4/203.0.113.1/tcp/4001/p2p/QmPeer1 \ --bootstrap /ip4/203.0.113.2/tcp/4001/p2p/QmPeer2Storage
Section titled “Storage”SQLite is used for persistent storage. Configure the database path:
society node --db /var/lib/society/production.dbFor high-availability deployments, consider:
- Regular SQLite backups
- WAL mode (enabled by default)
- Sufficient disk space for knowledge pool growth
Monitoring
Section titled “Monitoring”// Programmatic metricsconst metrics = await client.metrics();
// HTTP endpoint// GET http://localhost:8080/metricsSecurity Considerations
Section titled “Security Considerations”- API Keys — Always set API keys for the HTTP adapter in production
- Network — Use bootstrap nodes over public internet, mDNS for LAN only
- Storage — Encrypt the SQLite database at rest
- TLS — Put a reverse proxy (nginx) in front of the HTTP adapter
- Firewall — Only expose necessary ports (P2P + HTTP API)