1- ---
21{{- if .Values.topology.enabled }}
32apiVersion : v1
43kind : ConfigMap
54metadata :
65 name : {{ include "cardano-node.fullname" . }}-topology
7- namespace : {{ .Release.Namespace | default "default" }}
8- labels :
9- {{ include "cardano-node.labels" . | nindent 4 }}
106data :
11- topology.json : |-
12- {{ toJson .Values.topology.config | indent 4 }}
7+ topology.json : |
8+ {
9+ "bootstrapPeers": [{{- range $i, $peer := .Values.topology.bootstrapPeers }}
10+ {{- if $i }},{{ end }}
11+ { "address": "{{ $peer.address }}", "port": {{ $peer.port }} }
12+ {{- end }}],
13+ "localRoots": [
14+ {{- range $i, $local := .Values.topology.localRoots }}
15+ {{- if $i }},{{ end }}
16+ {
17+ "accessPoints": [
18+ {{- range $j, $peer := $local.accessPoints }}
19+ {{- if $j }},{{ end }}
20+ { "address": "{{ $peer.address }}", "port": {{ $peer.port }}, "name": "{{ $peer.name }}" }
21+ {{- end }}
22+ ],
23+ "advertise": {{ $local.advertise | toJson }},
24+ "trustable": {{ $local.trustable | default false | toJson }},
25+ "valency": {{ $local.valency }}
26+ }
27+ {{- end }}
28+ ]
29+ {{- with .Values.topology.peerSnapshotFile }},
30+ "peerSnapshotFile": "{{ . }}"
31+ {{- end }},
32+ "publicRoots": [{{- $hasPublicRoots := false }}
33+ {{- range $public := .Values.topology.publicRoots }}
34+ {{- if and (hasKey $public "accessPoints") (gt (len $public.accessPoints) 0) }}
35+ {{- $hasPublicRoots = true }}
36+ {{- end }}
37+ {{- end }}
38+ {{- if $hasPublicRoots }}
39+ {{- range $i, $public := .Values.topology.publicRoots }}
40+ {{- if and (hasKey $public "accessPoints") (gt (len $public.accessPoints) 0) }}
41+ {{- if $i }},{{ end }}
42+ {
43+ "accessPoints": [
44+ {{- range $j, $peer := $public.accessPoints }}
45+ {{- if $j }},{{ end }}
46+ { "address": "{{ $peer.address }}", "port": {{ $peer.port }}, "name": "{{ $peer.name }}" }
47+ {{- end }}
48+ ],
49+ "advertise": {{ $public.advertise | default false | toJson }}
50+ }
51+ {{- end }}
52+ {{- end }}
53+ {{- end }}],
54+ "useLedgerAfterSlot": {{ .Values.topology.useLedgerAfterSlot | int }}
55+ }
1356{{- end }}
0 commit comments