Lux Docs

Custom Topology

Configure network topology and connections

Netrunner supports custom network topologies to simulate different deployment configurations. Define the connectivity between nodes using a YAML topology file.

Topology File Format

nodes:
  - id: node-0
    role: bootstrap
    connections: [node-1, node-2, node-3, node-4]
  - id: node-1
    connections: [node-0, node-2]
  - id: node-2
    connections: [node-0, node-3]
  - id: node-3
    connections: [node-0, node-4]
  - id: node-4
    connections: [node-0, node-1]
latency: 10ms
bandwidth: 100mbps

Built-in Topologies

TopologyDescriptionUse Case
meshEvery node connects to every otherDefault, best finality
starAll nodes connect through a central hubTest hub failure scenarios
ringEach node connects to two neighborsMinimal connectivity
hierarchicalTree structure with bootstrap rootRealistic deployment sim

Use a Custom Topology

netrunner control start \
  --number-of-nodes=5 \
  --node-path=/path/to/luxd \
  --topology=my-topology.yaml

Network Conditions

Add realistic network conditions per link:

nodes:
  - id: node-0
    connections:
      - target: node-1
        latency: 5ms
      - target: node-2
        latency: 50ms
      - target: node-3
        latency: 200ms

defaults:
  latency: 10ms
  bandwidth: 100mbps
  packet_loss: 0.1%

Node Roles

RoleDescription
bootstrapFirst node started, other nodes connect to it
validatorNormal validator node (default)
apiAPI-only node, no validation
observerRead-only node, no consensus participation

Topology Visualization

After starting a network with a custom topology, view the actual connectivity:

netrunner control status --topology

This displays which nodes are connected and the measured latency between them.

On this page