Configuration
v2.0.0Complete yakmesh.config.js reference
Configure your YAKMESH node with yakmesh.config.js.
This file controls node identity, network ports, database settings, and security options.
"Configuration as code — versioned, reproducible, decentralized"
YAKMESH is designed to work out of the box with sensible defaults. The configuration file is optional for local development but essential for production deployments.
Quick Start
Generate a configuration file with the CLI:
npx yakmesh init
This creates yakmesh.config.js in your project root.
Full Configuration Structure
The complete configuration file with all available options:
export default {
// Node identity
node: {
name: 'My Yakmesh Node',
region: 'local',
capabilities: ['listings', 'chat', 'forum', 'qcoa'],
},
// Network settings
network: {
httpPort: 3000,
wsPort: 9001,
publicHost: 'localhost',
},
// Bootstrap nodes (optional - YAKMESH is decentralized)
bootstrap: [],
// Database
database: {
path: './data/peerquanta.db',
replication: {
enabled: true,
syncInterval: 30000, // 30 seconds
},
},
// Security
security: {
maxPeers: 50,
requireAuth: false,
},
};
Configuration Sections
node — Node Identity
Defines your node's identity on the mesh network.
| Option | Type | Default | Description |
|---|---|---|---|
name |
string | 'Yakmesh Node' |
Human-readable node name displayed to peers |
region |
string | 'local' |
Geographic region for peer discovery optimization |
capabilities |
string[] | ['listings'] |
Features this node supports (see Capabilities below) |
network — Network Settings
Configure HTTP and WebSocket ports for your node.
| Option | Type | Default | Description |
|---|---|---|---|
httpPort |
number | 3000 |
HTTP server port for REST API and web interface |
wsPort |
number | 9001 |
WebSocket port for mesh network P2P connections |
publicHost |
string | 'localhost' |
Public hostname or IP for peer connections |
bootstrap — Entry Point Nodes
Optional list of known nodes for initial network discovery. YAKMESH is fully decentralized — bootstrap nodes are just helpful starting points, not required.
bootstrap: [
'ws://node1.yakmesh.devwork:9001',
'ws://node2.yakmesh.devwork:9001',
'ws://192.168.1.100:9001', // Local network node
]
Tip: Leave empty for local development. Nodes discover each other automatically on the same network via mDNS/broadcast.
database — SQLite Database
Configure the PeerQuanta SQLite database for listings, identities, and mesh state.
| Option | Type | Default | Description |
|---|---|---|---|
path |
string | './data/peerquanta.db' |
Path to SQLite database file |
replication.enabled |
boolean | true |
Enable P2P database replication |
replication.syncInterval |
number | 30000 |
Sync interval in milliseconds (30 seconds) |
security — Security Settings
Control peer limits and authentication requirements.
| Option | Type | Default | Description |
|---|---|---|---|
maxPeers |
number | 50 |
Maximum concurrent peer connections |
requireAuth |
boolean | false |
Require authentication for API access |
Node Capabilities
Capabilities define what features your node supports on the mesh network. Peers can query these to find nodes that support specific services.
P2P Marketplace Listings — Host and serve marketplace listings, enable search and discovery of items across the mesh network.
Encrypted Messaging — Support end-to-end encrypted direct messaging via ANNEX P2P channels.
Discussion Boards — Host and replicate decentralized forum threads and discussions.
Quantum Certificate of Authenticity — Issue and verify QCoA certificates for item provenance.
Environment Variables
Override configuration options with environment variables. Environment variables take precedence over config file settings.
| Variable | Overrides | Example |
|---|---|---|
YAKMESH_PORT |
network.httpPort |
YAKMESH_PORT=8080 |
YAKMESH_WS_PORT |
network.wsPort |
YAKMESH_WS_PORT=9002 |
YAKMESH_DATA_DIR |
database.path |
YAKMESH_DATA_DIR=/var/yakmesh/data |
# Example: Start with custom ports
YAKMESH_PORT=8080 YAKMESH_WS_PORT=9002 npx yakmesh start
Deployment Examples
Local Development
Minimal configuration for local development and testing:
// yakmesh.config.js — Local Development
export default {
node: {
name: 'Dev Node',
region: 'local',
capabilities: ['listings', 'chat'],
},
network: {
httpPort: 3000,
wsPort: 9001,
publicHost: 'localhost',
},
database: {
path: './data/dev.db',
replication: {
enabled: false, // Disable for faster local dev
},
},
security: {
maxPeers: 5,
requireAuth: false,
},
};
Production Deployment
Hardened configuration for production servers:
// yakmesh.config.js — Production
export default {
node: {
name: 'YakMesh Production Node',
region: 'us-west',
capabilities: ['listings', 'chat', 'forum', 'qcoa'],
},
network: {
httpPort: 80,
wsPort: 443,
publicHost: 'node.yourdomain.com',
},
bootstrap: [
'wss://gateway1.yakmesh.devwork:443',
'wss://gateway2.yakmesh.devwork:443',
],
database: {
path: '/var/yakmesh/data/peerquanta.db',
replication: {
enabled: true,
syncInterval: 15000, // More frequent sync
},
},
security: {
maxPeers: 100,
requireAuth: true, // Enable authentication
},
};
Landmark Node (High Availability)
Configuration for landmark nodes that serve as stable reference points in the mesh:
// yakmesh.config.js — Landmark Node
export default {
node: {
name: 'Everest Landmark',
region: 'asia-south',
capabilities: ['listings', 'chat', 'forum', 'qcoa'],
},
network: {
httpPort: 3000,
wsPort: 9001,
publicHost: 'everest.yakmesh.devwork',
},
bootstrap: [], // Landmark nodes don't need bootstrap
database: {
path: '/mnt/ssd/yakmesh/peerquanta.db',
replication: {
enabled: true,
syncInterval: 10000, // Aggressive sync
},
},
security: {
maxPeers: 200, // High peer capacity
requireAuth: false, // Open for mesh access
},
};
Configuration Tips
Port Selection
If ports are in use, YAKMESH will automatically try sequential ports (9001 → 9002 → 9003...). Use environment variables for container deployments.
Public Host
Set publicHost to your actual public IP or domain
so other peers can connect back to your node.
Bootstrap Nodes
Only needed for initial discovery. Once connected to the mesh, your node learns about other peers through gossip protocol.
Database Path
Use absolute paths in production. The directory must exist and be writable. SQLite is automatically initialized on first run.
Related Documentation
- CLI Commands — Initialize and manage nodes
- MANDALA (Mesh) — P2P mesh networking
- SHERPA — Peer discovery system
- ANNEX — P2P encrypted channels
- SURAKSHA — Authentication and trust
- Web Server — Hosting configuration