diff --git a/charts/tezos/scripts/evm-proxy.sh b/charts/tezos/scripts/evm-proxy.sh deleted file mode 100644 index a62c088..0000000 --- a/charts/tezos/scripts/evm-proxy.sh +++ /dev/null @@ -1,10 +0,0 @@ -set -ex - -TEZ_BIN=/usr/local/bin - -CMD="$TEZ_BIN/octez-evm-node run proxy \ - with endpoint http://rollup-${MY_POD_NAME}:8932 \ - --devmode \ - --rpc-addr 0.0.0.0" - -exec $CMD diff --git a/charts/tezos/scripts/evm-sequencer.sh b/charts/tezos/scripts/evm-sequencer.sh new file mode 100644 index 0000000..fe9c370 --- /dev/null +++ b/charts/tezos/scripts/evm-sequencer.sh @@ -0,0 +1,22 @@ +set -e + +TEZ_VAR=/var/tezos +TEZ_BIN=/usr/local/bin +CLIENT_DIR="$TEZ_VAR/client" +ROLLUP_DATA_DIR="$TEZ_VAR/rollup" +SEQUENCER_DATA_DIR="$TEZ_VAR/sequencer" + +set -x + +octez-evm-node init from rollup node ${ROLLUP_DATA_DIR} \ +--data-dir ${SEQUENCER_DATA_DIR} + + +CMD="$TEZ_BIN/octez-evm-node run sequencer \ + with endpoint http://rollup-${MY_POD_NAME}:8932 \ + signing with edsk3rw6fcwjPe5xkGWAbSquLDQALKP8XyMhy4c6PQGr7qQKTYa8rX \ + --data-dir ${SEQUENCER_DATA_DIR} \ + --time-between-blocks 6 \ + --rpc-addr 0.0.0.0" + +exec $CMD diff --git a/charts/tezos/scripts/smart-rollup-node.sh b/charts/tezos/scripts/smart-rollup-node.sh index 678612c..f9bb373 100644 --- a/charts/tezos/scripts/smart-rollup-node.sh +++ b/charts/tezos/scripts/smart-rollup-node.sh @@ -1,4 +1,4 @@ -set -ex +set -e TEZ_VAR=/var/tezos TEZ_BIN=/usr/local/bin @@ -9,7 +9,8 @@ ROLLUP_DATA_DIR_PREIMAGES="$ROLLUP_DATA_DIR/wasm_2_0_0" xxd -p -c 0 /usr/local/share/tezos/evm_kernel/evm_installer.wasm | tr -d '\n' > /var/tezos/smart-rollup-boot-sector mkdir -p "$ROLLUP_DATA_DIR_PREIMAGES" cp /usr/local/share/tezos/evm_kernel/* "$ROLLUP_DATA_DIR_PREIMAGES" -ls -al $ROLLUP_DATA_DIR + +set -x $TEZ_BIN/octez-smart-rollup-node \ --endpoint http://tezos-node-rpc:8732 \ -d $CLIENT_DIR \ diff --git a/charts/tezos/templates/octez-rollup-node.yaml b/charts/tezos/templates/octez-rollup-node.yaml index b6c6a95..c5a7a2a 100644 --- a/charts/tezos/templates/octez-rollup-node.yaml +++ b/charts/tezos/templates/octez-rollup-node.yaml @@ -1,67 +1,24 @@ {{- range $k, $v := .Values.smartRollupNodes }} -{{- if $v.evm_proxy | default false }} apiVersion: v1 kind: Service metadata: - name: evm-proxy-{{ $k }} + name: sequencer-{{ $k }} namespace: {{ $.Release.Namespace }} spec: type: NodePort ports: - port: 8545 - name: evm-proxy + name: sequencer selector: - app: evm-proxy-{{ $k }} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: evm-proxy-{{ $k }} - namespace: {{ $.Release.Namespace }} -{{- if $v.evm_proxy.annotations | default false }} -{{- with $v.evm_proxy.annotations }} - annotations: - {{- toYaml . | nindent 4 }} -{{- end }} -{{- end }} -spec: - podManagementPolicy: Parallel - replicas: 1 - serviceName: evm-proxy-{{ $k }} - selector: - matchLabels: - app: evm-proxy-{{ $k }} - template: - metadata: - labels: - app: evm-proxy-{{ $k }} - spec: - containers: - - name: octez-evm-proxy - image: "{{ $.Values.images.octez }}" - imagePullPolicy: {{ $.Values.images_pull_policy }} - ports: - - containerPort: 8545 - name: evm-proxy - command: - - /bin/sh - args: - - "-c" - - | -{{ tpl ($.Files.Get "scripts/evm-proxy.sh") $ | indent 12 }} - env: - - name: MY_POD_NAME - value: {{ $k }} - securityContext: - fsGroup: 1000 + app: rollup-{{ $k }} --- {{- if $v.evm_proxy.ingress | default false }} {{- if $v.evm_proxy.ingress.enabled | default false }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: evm-proxy-{{ $k }} + name: sequencer-{{ $k }} namespace: {{ $.Release.Namespace }} {{- with $v.evm_proxy.ingress.labels }} labels: @@ -91,10 +48,9 @@ spec: path: / backend: service: - name: evm-proxy-{{ $k }} + name: sequencer-{{ $k }} port: - name: evm-proxy -{{- end }} + name: sequencer {{- end }} {{- end }} --- @@ -159,6 +115,24 @@ spec: {{- $cleanKey := regexReplaceAll "[0-9]+$" $key "" }} {{ $cleanKey }}:{{ $value }} {{- end }} + - name: octez-sequencer + image: "{{ $.Values.images.octez }}" + imagePullPolicy: {{ $.Values.images_pull_policy }} + ports: + - containerPort: 8545 + name: sequencer + command: + - /bin/sh + args: + - "-c" + - | +{{ tpl ($.Files.Get "scripts/evm-sequencer.sh") $ | indent 12 }} + volumeMounts: + - mountPath: /var/tezos + name: var-volume + env: + - name: MY_POD_NAME + value: {{ $k }} initContainers: - image: {{ $.Values.tezos_k8s_images.utils }} imagePullPolicy: {{ $.Values.tezos_k8s_images_pull_policy }}