Skip to content

Commit a1a25a0

Browse files
authored
chore: add p2p and optional sequencer (#253)
1 parent a7bd61a commit a1a25a0

4 files changed

Lines changed: 38 additions & 8 deletions

File tree

charts/op-node/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.5.1
18+
version: 0.6.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/op-node/templates/service.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ spec:
1313
targetPort: rpc
1414
protocol: TCP
1515
name: rpc
16+
{{- if .Values.service.p2p.enabled }}
17+
- port: {{ .Values.service.p2p.port }}
18+
targetPort: p2p
19+
protocol: TCP
20+
name: p2p
21+
{{- end }}
1622
# StatefulSets require headless services
1723
# https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#limitations
1824
clusterIP: {{ .Values.service.clusterIP }}

charts/op-node/templates/statefulset.yaml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,37 @@ spec:
4141
op-node \
4242
--l2={{ .Values.config.l2.opGethAuthUrl }} \
4343
--l2.jwt-secret=/chainconfig/jwt.txt \
44-
--sequencer.enabled \
45-
--sequencer.l1-confs=5 \
46-
--verifier.l1-confs=4 \
44+
--sequencer.enabled={{ .Values.config.sequencer.enabled }} \
45+
--p2p.no-discovery=true \
46+
{{- if .Values.service.p2p.enabled }}
47+
--p2p.listen.tcp={{ .Values.service.p2p.port }} \
48+
{{- end }}
49+
{{- if .Values.config.sequencer.enabled }}
50+
--sequencer.l1-confs={{ .Values.config.sequencer.l1Confs }} \
51+
--p2p.sequencer.key={{ index $opSecrets.data "sequencer_private_key" | b64dec }} \
52+
{{- end }}
53+
--verifier.l1-confs={{ .Values.config.verifier.l1Confs }} \
54+
{{- if and (not .Values.config.sequencer.enabled) .Values.config.verifier.sequencerHttp }}
55+
--rollup.sequencer-http={{ .Values.config.verifier.sequencerHttp }} \
56+
{{- end }}
4757
--rollup.config=/chainconfig/rollup.json \
4858
--rpc.addr=0.0.0.0 \
4959
--rpc.enable-admin \
50-
--p2p.disable \
51-
--p2p.sequencer.key={{ index $opSecrets.data "sequencer_private_key" | b64dec }} \
5260
--l1={{ index $opSecrets.data "l1RpcURL" | b64dec }} \
5361
--l1.beacon={{ index $opSecrets.data "l1RpcURL" | b64dec }} \
54-
--rollup.config=/chainconfig/rollup.json \
5562
{{- range .Values.config.extraOptions }}
5663
--{{ . }} \
57-
{{- end}}
64+
{{- end }}
5865
--safedb.path=/data
5966
ports:
6067
- name: rpc
6168
containerPort: {{ .Values.service.rpc.port }}
6269
protocol: TCP
70+
{{- if .Values.service.p2p.enabled }}
71+
- name: p2p
72+
containerPort: {{ .Values.service.p2p.port }}
73+
protocol: TCP
74+
{{- end }}
6375
resources:
6476
{{- toYaml .Values.resources | nindent 12 }}
6577
volumeMounts:

charts/op-node/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ service:
2424
clusterIP: None
2525
rpc:
2626
port: 9545
27+
p2p:
28+
enabled: true
29+
port: 9222
2730
annotations: {}
2831

2932
ingress:
@@ -38,6 +41,15 @@ existingSecret: "secretName"
3841
config:
3942
extraOptions: {}
4043

44+
sequencer:
45+
enabled: true
46+
l1Confs: 4
47+
48+
# Verifier configuration (used when sequencer.enabled=false)
49+
verifier:
50+
l1Confs: 12
51+
sequencerHttp: ""
52+
4153
l2:
4254
opGethAuthUrl: http://op-geth:8551
4355

0 commit comments

Comments
 (0)