Skip to content

Node binaries and ports

The zentalk-node repository ships three long-running network binaries plus operator tools. This page covers the network binaries, their ports, and the transport stack; see the CLI reference for the client and operator tools.

Binary Role Main port (default) Health/metrics port (default)
relay P2P message routing, sealed-sender relay, group/channel routing, ZK auth -port 9001 -health-port, defaults to relay port + 90 (9091)
mesh-api Mesh storage node: DHT member + Mesh Storage API (HTTP) -port 9000 (DHT P2P) -api-port 8080 (HTTP API, includes /health)
dht-bootstrap DHT bootstrap node for peer discovery -port 9000 -health-port 9092 (/health, /metrics, /stats)

The federation Docker Compose environment uses this port layout:

Service Container port Host port (server 1 / server 2)
DHT bootstrap (shared) 9000 9000
Relay 9001 9001 / 9002
Relay metrics 9090 9091 / 9092
Mesh P2P 9100 9101 / 9102
Mesh Storage API 8080 8081 / 8082

Independently of any compose layout, the relay’s DHT listener is always relay port + 100 (e.g. 90019101).

All three binaries load a local .env file if present and shut down gracefully on SIGINT/SIGTERM (timeout configurable via SHUTDOWN_TIMEOUT, default 30s).

Start a relay
relay -operator 0xYourEthereumAddress -port 9001

Key flags (see relay -h for the full set):

Flag Default Description
-operator — (required) Operator ETH address
-network mainnet mainnet or testnet
-port 9001 Relay listen port
-health-port port + 90 Health check HTTP port
-key ./keys/relay.pem Private key file (RSA-4096; generated on first run)
-genkey false Force-generate a new key
-mesh true Auto-mesh formation with other relays
-peers 5 Target relay peer count for the mesh
-bootstrap Override bootstrap DHT multiaddr
-mesh-url http://localhost:8080 Mesh Storage API URL
-data-dir ./data Persisted relay state (nonces, reputation)
-enable-groups / -enable-channels true Group / channel message routing
-offline-ttl 2592000 Offline queue TTL in seconds (30 days)
-enable-zk / -disable-zk ZK on Zero-knowledge anonymous authentication
-zk-keys ./zkp-keys ZK setup keys directory (from zkp-setup)
-zk-registry ./data/zkp-registry.json ZK user registry file
-zk-tree-depth 20 Merkle tree depth (2^20 ≈ 1M users)
-auto-update true DHT-announced auto-updates, applied inside -update-start/-update-end (default 02:00–06:00)

The relay persists its offline message queue in PostgreSQL (database zentalk_relay_<port> by default; override with ZENTALK_RELAY_PG_DATABASE). With ZK enabled, the verifying key from zkp-setup must exist before boot or the relay exits.

Start a mesh storage node
mesh-api -port 9100 -api-port 8080 \
-bootstrap /dns4/bootstrap.zentalk.chat/tcp/9000/p2p/12D3Koo...
Flag Default Description
-port 9000 libp2p DHT port
-api-port 8080 Mesh Storage API (HTTP) port
-data ./mesh-data Data directory
-bootstrap Comma-separated bootstrap multiaddrs; each entry must include /p2p/{peerID} — unpinned entries are rejected to prevent eclipse attacks
-cors true CORS headers on the HTTP API
-rate-limit 100 HTTP requests per minute
-max-upload 100 Maximum upload size (MB)

In production the mesh API requires ZENTALK_JWT_SECRET at boot (it must match the API server’s secret). The HTTP surface — chunk upload/download, media chunks and manifests, username registry, network and node info — is documented in the Mesh Storage API reference. GET /health on the API port serves as the liveness check.

Start a bootstrap node
dht-bootstrap -port 9000 -health-port 9092
Flag Default Description
-port 9000 libp2p DHT port
-health-port 9092 Health and metrics HTTP port
-data ./bootstrap-data Data directory

The bootstrap node is the rendezvous point for peer discovery: relays and mesh nodes dial it at startup and join the shared DHT. It also answers key-bundle and file-storage RPCs.

All node binaries build on the same libp2p host configuration:

  • Transports — TCP listener on the configured port, with libp2p’s default transport set.
  • Channel security — libp2p default security: TLS 1.3 and Noise.
  • Peer discovery — Kademlia DHT in server mode.
  • NAT traversal — UPnP port mapping and AutoNAT service are always on. DCUtR hole punching and the circuit-relay-v2 client transport are enabled by default so peers behind symmetric NAT can connect; opt out per node with ZENTALK_LIBP2P_HOLEPUNCH=false or ZENTALK_LIBP2P_RELAY_CLIENT=false.
  • Bootstrap pinning — bootstrap multiaddrs must carry a /p2p/<PeerID> suffix; entries without a pinned peer ID are rejected.
Endpoint Served by Content
http://<host>:9091/health relay health server Liveness + relay stats
http://<host>:9091/topology relay health server Current relay mesh topology
http://<host>:9091/updates relay health server Auto-update status
http://<host>:8080/health mesh-api Liveness
http://<host>:9092/health dht-bootstrap Liveness + peer count
http://<host>:9092/metrics dht-bootstrap Prometheus metrics
http://<host>:9092/stats dht-bootstrap Node info (peers, storage)