-
Notifications
You must be signed in to change notification settings - Fork 164
Expand file tree
/
Copy patheth2.tmpl
More file actions
128 lines (126 loc) · 4.96 KB
/
eth2.tmpl
File metadata and controls
128 lines (126 loc) · 4.96 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Autogenerated - DO NOT MODIFY THIS FILE DIRECTLY
# If you want to overwrite some of these values with your own customizations,
# please add them to `override/eth2.yml`.
#
# See https://docs.docker.com/compose/extends/#adding-and-overriding-configuration
# for more information on overriding specific parameters of docker-compose files.
{{define "GENESIS_DL"}}
eth2_genesis_downloader:
image: curlimages/curl:8.13.0
user: root
container_name: {{.Smartnode.ProjectName}}_genesis_downloader
volumes:
- eth2clientdata:/ethclient
- {{.RocketPoolDirectory}}/scripts:/setup:ro
network_mode: host
environment:
- NETWORK={{.Smartnode.Network}}
entrypoint: sh
command: "/setup/download-genesis.sh"
{{end}}
services:
eth2:
image: {{.GetBeaconContainerTag}}
user: root
container_name: {{.Smartnode.ProjectName}}_eth2
restart: unless-stopped
stop_grace_period: 3m
{{- $p2p := (or .ConsensusCommon.P2pPort.String "9001")}}
ports:
- "{{$p2p}}:{{$p2p}}/udp"
- "{{$p2p}}:{{$p2p}}/tcp"
{{- if .IsIPv6Enabled}}
- "[::]:{{$p2p}}:{{$p2p}}/udp"
- "[::]:{{$p2p}}:{{$p2p}}/tcp"
{{- end}}
{{- if eq .ConsensusClient.String "lighthouse"}}
- "{{.Lighthouse.P2pQuicPort}}:{{.Lighthouse.P2pQuicPort}}/udp"
{{- if .IsIPv6Enabled}}
- "[::]:{{.Lighthouse.P2pQuicPort}}:{{.Lighthouse.P2pQuicPort}}/udp"
{{- end}}
{{- else if eq .ConsensusClient.String "prysm"}}
- "{{.Prysm.P2pQuicPort}}:{{.Prysm.P2pQuicPort}}/udp"
{{- if .IsIPv6Enabled}}
- "[::]:{{.Prysm.P2pQuicPort}}:{{.Prysm.P2pQuicPort}}/udp"
{{- end}}
{{- end}}
{{- if and (eq .ConsensusClient.String "teku") .IsIPv6Enabled}}
- "{{.Teku.P2pIpv6Port}}:{{.Teku.P2pIpv6Port}}/udp"
- "{{.Teku.P2pIpv6Port}}:{{.Teku.P2pIpv6Port}}/tcp"
{{- end}}
{{- range $entry := .GetBnOpenPorts}}
- "{{$entry}}"
{{- end}}
volumes:
- {{.Smartnode.DataPath}}/validators:/validators
- {{.Smartnode.DataPath}}/secrets:/secrets:ro
- eth2clientdata:/ethclient
- {{.RocketPoolDirectory}}/scripts:/setup:ro
- {{.RocketPoolDirectory}}/devnet:/devnet:ro
networks:
- net
environment:
- NETWORK={{.Smartnode.Network}}
- EC_CLIENT={{if .ExecutionClientLocal}}{{.ExecutionClient}}{{else}}X{{end}}
- CC_CLIENT={{if .ConsensusClientLocal}}{{.ConsensusClient}}{{else}}{{.ExternalConsensusClient}}{{end}}
- EC_HTTP_ENDPOINT={{.GetEcHttpEndpoint}}
- EC_WS_ENDPOINT={{.GetEcWsEndpoint}}
- EC_ENGINE_ENDPOINT=http://{{.GetExecutionHostname}}:{{.ExecutionCommon.EnginePort}}
- EC_ENGINE_WS_ENDPOINT=ws://{{.GetExecutionHostname}}:{{.ExecutionCommon.EnginePort}}
- CUSTOM_GRAFFITI={{.CustomGraffiti}}
- ROCKET_POOL_VERSION=v{{.RocketPoolVersion}}
- BN_SUGGESTED_BLOCK_GAS_LIMIT={{.ConsensusCommon.SuggestedBlockGasLimit}}
- BN_P2P_PORT={{$p2p}}
- BN_API_PORT={{.ConsensusCommon.ApiPort}}
- BN_MAX_PEERS={{.GetBNMaxPeers}}
- ENABLE_METRICS={{.EnableMetrics}}
- BN_METRICS_PORT={{.BnMetricsPort}}
- EXTERNAL_IP={{.GetExternalIp}}
- ENABLE_IPV6={{.IsIPv6Enabled}}
- CHECKPOINT_SYNC_URL={{.ConsensusCommon.CheckpointSyncProvider}}
- DOPPELGANGER_DETECTION={{.IsDoppelgangerEnabled}}
- BN_ADDITIONAL_FLAGS={{.GetBNAdditionalFlags}}
- FEE_RECIPIENT_FILE={{.FeeRecipientFile}}
- ENABLE_BITFLY_NODE_METRICS={{.EnableBitflyNodeMetrics}}
- BITFLY_NODE_METRICS_SECRET={{.BitflyNodeMetrics.Secret}}
- BITFLY_NODE_METRICS_ENDPOINT={{.BitflyNodeMetrics.Endpoint}}
- BITFLY_NODE_METRICS_MACHINE_NAME={{.BitflyNodeMetrics.MachineName}}
- PBS_URL={{.PbsUrl}}
- RETH_ADDRESS={{.Smartnode.GetRethAddress.Hex}}
- GRAFFITI={{.Graffiti}}
- ADDON_GWW_ENABLED={{.GraffitiWallWriter.GetEnabledParameter}}
{{- /* Client-specific values */}}
{{- if eq .ConsensusClient.String "teku"}}
- TEKU_JVM_HEAP_SIZE={{.Teku.JvmHeapSize}}
- TEKU_ARCHIVE_MODE={{.Teku.ArchiveMode}}
- BN_IPV6_P2P_PORT={{.Teku.P2pIpv6Port}}
{{- else if eq .ConsensusClient.String "prysm"}}
- BN_RPC_PORT={{.Prysm.RpcPort}}
- BN_P2P_QUIC_PORT={{.Prysm.P2pQuicPort}}
{{- else if eq .ConsensusClient.String "nimbus"}}
- NIMBUS_PRUNING_MODE={{.Nimbus.PruningMode}}
{{- else if eq .ConsensusClient.String "lighthouse"}}
- BN_P2P_QUIC_PORT={{.Lighthouse.P2pQuicPort}}
{{- end}}
command: "/setup/start-bn.sh"
cap_drop:
- all
cap_add:
- dac_override
security_opt:
- no-new-privileges
entrypoint: {{ .GetEth2Entrypoint }}
{{- if eq .ConsensusClient.String "prysm"}}
{{- /* prysm may need us to download genesis for testnets */}}
depends_on:
eth2_genesis_downloader:
condition: service_completed_successfully
{{- template "GENESIS_DL" . }}
{{- end}}
networks:
net:
{{- if .IsIPv6Enabled}}
enable_ipv6: true
{{- end}}
volumes:
eth2clientdata: