Repository navigation
Expand file tree
/
Copy pathnodes.tf
More file actions
60 lines (56 loc) · 2.69 KB
/
Copy pathnodes.tf
File metadata and controls
60 lines (56 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
########################################################################################
# NODE DEFINITIONS
#
# Define your fleet as a list of node entries. Each entry supports:
#
# Required:
# - name : Node type (e.g., "lighthouse-geth-super", "bootnode")
# - count : Number of instances
# - cloud : "digitalocean" or "hetzner"
#
# Optional:
# - validator_start : First validator index (default: 0)
# - validator_end : Last validator index (default: 0)
# - size : Instance size override (provider-specific)
# - region : Region override (digitalocean) or location (hetzner)
# - supernode : Force supernode=true/false (auto-detected from name)
# - builder_start : First builder index (buildoor nodes only). Exposes a
# builder_index=N server tag and inventory var per instance.
#
# Examples:
# { name = "bootnode", count = 1, cloud = "digitalocean" }
# { name = "lighthouse-geth-super", count = 2, cloud = "hetzner", validator_start = 0, validator_end = 200 }
# { name = "mev-relay", count = 1, cloud = "hetzner", size = "ccx53" }
#
########################################################################################
variable "nodes" {
description = "List of node definitions for the devnet"
default = [
{ name = "bootnode", count = 1, cloud = "digitalocean" },
{ name = "mev-relay", count = 1, cloud = "hetzner", size = "ccx53" },
{ name = "buildoor-prysm-geth", count = 1, cloud = "hetzner" },
{ name = "lighthouse-geth", count = 2, cloud = "digitalocean", validator_start = 0, validator_end = 400 },
{ name = "lighthouse-geth", count = 1, cloud = "hetzner", validator_start = 400, validator_end = 500 },
{ name = "prysm-nethermind", count = 1, cloud = "hetzner", validator_start = 500, validator_end = 550 },
]
validation {
condition = alltrue([
for n in var.nodes :
try(n.validator_start, 0) >= 0 && try(n.validator_start, 0) <= try(n.validator_end, 0)
])
error_message = "Each node must satisfy 0 <= validator_start <= validator_end. Omit both fields (or set both to 0) for nodes without validators."
}
validation {
condition = alltrue(flatten([
for i, a in var.nodes : [
for j, b in var.nodes :
i >= j ||
try(a.validator_end, 0) == 0 ||
try(b.validator_end, 0) == 0 ||
try(a.validator_end, 0) <= try(b.validator_start, 0) ||
try(b.validator_end, 0) <= try(a.validator_start, 0)
]
]))
error_message = "Validator ranges overlap between nodes. Each [validator_start, validator_end) interval must be disjoint from every other node's interval."
}
}