Network Architecture
How Flux works under the hood — blockchain, FluxOS, FDM domain management, Syncthing, and the API gateway.
Network Architecture — How Flux Works Under the Hood
The Flux network is a complex system of interconnected components: a blockchain for consensus, FluxOS for compute orchestration, a domain management system for traffic routing, and multiple APIs for data access. Understanding this architecture helps operators troubleshoot issues and developers build on the platform.
Architecture Overview
- •Flux Blockchain (fluxd): C++ daemon (Zcash fork) — handles consensus, collateral, node registration, and app specifications on-chain
- •FluxOS: MEVN application (MongoDB, Express, Vue, Node.js) — orchestrates Docker containers, manages P2P communication, exposes the REST API
- •FluxBench: Hardware benchmarking daemon — periodically tests CPU, RAM, SSD, and network performance
- •FDM (Flux Domain Manager): HAProxy-based load balancer — manages DNS records, SSL certificates, and traffic routing
- •Stats API: Network-wide data aggregator — collects information from all nodes for dashboards and monitoring
Network Communication
Flux nodes communicate peer-to-peer using a gossip protocol. Each node maintains connections to other nodes:
- •Outgoing connections: Your node initiates connections to known peers
- •Incoming connections: Other nodes connect to your node
- •Message broadcast: Messages (app deployments, updates, hash verification) propagate through the network via gossip
- •DOS protection: The network monitors node behavior and can temporarily ban misbehaving nodes
Domain Manager (FDM)
FDM is responsible for making Flux applications accessible via standard domain names. It dynamically manages HAProxy configuration to route traffic to healthy nodes:
| Domain Pattern | Routes To |
|---|---|
| home.runonflux.io | Flux UI (load-balanced across healthy nodes) |
| api.runonflux.io | Flux API (load-balanced) |
| APPNAME.app.runonflux.io | Application (load-balanced across running instances) |
| APPNAME_PORT.app.runonflux.io | Multi-port application endpoints |
FDM integrates with Cloudflare and/or PowerDNS for DNS record management, and uses Let's Encrypt with Certbot for automatic SSL certificate provisioning.
Data Flow: Deploying an App
- 1
User submits spec
The app specification (Docker image, resources, instances) is signed by the user and broadcast to the Flux network.
- 2
On-chain registration
The specification is recorded on the Flux blockchain as a transaction, including the payment in FLUX.
- 3
Network propagation
FluxOS nodes receive the spec via gossip protocol and check if they have sufficient resources.
- 4
Container deployment
Eligible nodes pull the Docker image and start the container according to the spec.
- 5
Health monitoring
FluxOS continuously monitors container health. If a node goes down, the app is redeployed elsewhere automatically.
- 6
DNS routing
FDM detects the running instances and creates DNS records pointing to all healthy nodes running the app.
- 7
Traffic distribution
HAProxy load-balances incoming requests across all instances. SSL is terminated at the FDM level.
Key API Gateways
| Gateway | URL | Description |
|---|---|---|
| Production API | api.runonflux.io | Load-balanced API across all healthy nodes |
| Backup API | api.runonflux.com | Backup production endpoint |
| Stats API | stats.runonflux.io | Aggregated network statistics |
| Explorer | explorer.runonflux.io | Blockchain explorer |
| Direct Node | NODE_IP:16127 | Direct access to a specific node's API |
| Testnet | testnet-api.runonflux.io | Testnet API for development |
MongoDB Databases
Each FluxOS node maintains local MongoDB databases:
| Database | Purpose |
|---|---|
| zelfluxlocal | Logged users, login phrases, signatures, payments, geolocation cache, benchmark cache |
| zelcashdata | Scanned block height, UTXO index, address transactions, FluxNode transactions, app hashes |
| localzelapps | Locally installed app information and metadata |
| globalzelapps | Network-wide app messages, specifications, deployment locations, install errors |
| chainparams | Chain-level parameters and soft fork messages |
| zelshare | FluxShare file sharing metadata |
Syncthing — Distributed File Sync
Flux uses Syncthing for decentralized file synchronization between nodes running the same application. When an app writes data to persistent storage, Syncthing ensures all instances of that app maintain consistent data across nodes. This is critical for stateful applications like databases and content management systems.
The FluxOS API exposes 50+ Syncthing management endpoints under /syncthing/ for configuring devices, folders, and sync status. These are used internally by FluxOS and are generally not needed by operators.
Other articles in Flux Ecosystem
FluxCloud Deployment Guide
Deploy apps via Docker or Git CI/CD, manage instances, marketplace templates, and pricing model.
FluxEdge GPU Computing
Decentralized GPU marketplace — rent H100/A100 GPUs for AI, rendering, and compute workloads.
FluxCore Desktop App
Turn your PC into a FluxEdge compute provider. Install, benchmark, and start earning FLUX.
Wallet Management
ZelCore, SSP Wallet, collateral management, address types, and security best practices.
Fusion & Cross-Chain Bridge
Bridge FLUX across 8+ blockchains, claim parallel mining rewards, and understand supply lock mechanics.