Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
452 changes: 452 additions & 0 deletions .github/workflows/helm-integration-tests.yml

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions helm/commonware-restaking/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v2
name: commonware-restaking
description: A Helm chart for deploying Commonware Restaking AVS with EigenLayer integration
type: application
version: 0.1.0
appVersion: "1.0.0"
keywords:
- commonware
- avs
- eigenlayer
- ethereum
maintainers:
- name: Breadchain
61 changes: 61 additions & 0 deletions helm/commonware-restaking/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Thank you for installing {{ .Chart.Name }}!

Your release is named {{ .Release.Name }}.

== DEPLOYMENT STATUS ==

The Commonware AVS stack is being deployed with the following components:

1. Ethereum (Anvil) - Local blockchain with forked Holesky state
2. Signer (Cerberus) - BLS signature service
3. Setup Job - EigenLayer contract deployment
4. {{ .Values.global.nodeCount }} AVS Nodes - Operator nodes
5. Router - Request routing and aggregation

== SETUP JOB ==

A setup job will run after installation to:
- Deploy EigenLayer contracts
- Create {{ .Values.global.nodeCount }} test operator accounts

Monitor the setup job:
kubectl get jobs -l app.kubernetes.io/instance={{ .Release.Name }}
kubectl logs job/{{ include "commonware-avs.setup.fullname" . }}

== ACCESSING SERVICES ==

Ethereum RPC:
kubectl port-forward svc/{{ include "commonware-avs.ethereum.fullname" . }} 8545:{{ .Values.ethereum.service.port }}

Router:
kubectl port-forward svc/{{ include "commonware-avs.router.fullname" . }} 3000:{{ .Values.router.service.port }}

Router Ingress (if enabled):
kubectl port-forward svc/{{ include "commonware-avs.router.fullname" . }} 8080:{{ .Values.router.service.ingressPort }}

{{- if .Values.ingress.enabled }}

Ingress:
{{- range .Values.ingress.hosts }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .host }}
{{- end }}
{{- end }}

== TROUBLESHOOTING ==

Check pod status:
kubectl get pods -l app.kubernetes.io/instance={{ .Release.Name }}

View logs for a specific component:
kubectl logs -l app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=ethereum
kubectl logs -l app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=node
kubectl logs -l app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=router

Check shared data volume:
kubectl get pvc {{ include "commonware-avs.shareddata.fullname" . }}

== CONFIGURATION ==

Environment: {{ .Values.global.environment }}
Node Count: {{ .Values.global.nodeCount }}
Usecase: {{ .Values.node.usecase }}
109 changes: 109 additions & 0 deletions helm/commonware-restaking/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "commonware-avs.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
*/}}
{{- define "commonware-avs.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "commonware-avs.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "commonware-avs.labels" -}}
helm.sh/chart: {{ include "commonware-avs.chart" . }}
{{ include "commonware-avs.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "commonware-avs.selectorLabels" -}}
app.kubernetes.io/name: {{ include "commonware-avs.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Ethereum service name
*/}}
{{- define "commonware-avs.ethereum.fullname" -}}
{{- printf "%s-ethereum" (include "commonware-avs.fullname" .) }}
{{- end }}

{{/*
Signer service name
*/}}
{{- define "commonware-avs.signer.fullname" -}}
{{- printf "%s-signer" (include "commonware-avs.fullname" .) }}
{{- end }}

{{/*
Router service name
*/}}
{{- define "commonware-avs.router.fullname" -}}
{{- printf "%s-router" (include "commonware-avs.fullname" .) }}
{{- end }}

{{/*
Node name helper
*/}}
{{- define "commonware-avs.node.fullname" -}}
{{- printf "%s-node" (include "commonware-avs.fullname" .) }}
{{- end }}

{{/*
Setup job name
*/}}
{{- define "commonware-avs.setup.fullname" -}}
{{- printf "%s-setup" (include "commonware-avs.fullname" .) }}
{{- end }}

{{/*
Shared data PVC name
*/}}
{{- define "commonware-avs.shareddata.fullname" -}}
{{- printf "%s-shared-data" (include "commonware-avs.fullname" .) }}
{{- end }}

{{/*
Config ConfigMap name
*/}}
{{- define "commonware-avs.config.fullname" -}}
{{- printf "%s-config" (include "commonware-avs.fullname" .) }}
{{- end }}

{{/*
Secret name - supports existing secret or creates new one
*/}}
{{- define "commonware-avs.secret.fullname" -}}
{{- if .Values.secrets.existingSecret }}
{{- .Values.secrets.existingSecret }}
{{- else }}
{{- printf "%s-secret" (include "commonware-avs.fullname" .) }}
{{- end }}
{{- end }}
35 changes: 35 additions & 0 deletions helm/commonware-restaking/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "commonware-avs.config.fullname" . }}
labels:
{{- include "commonware-avs.labels" . | nindent 4 }}
data:
# EigenLayer setup config - dynamically generates operator socket addresses
# This replaces config/config.example.json with Kubernetes service names
config.json: |
{
"quorum": {
"minimumStake": "1",
"maxOperatorCount": 32,
"kickBIPsOfOperatorStake": 10000,
"kickBIPsOfTotalStake": 100
},
"metadata": {
"uri": "metadataURI"
},
"operators": {
{{- $nodeCount := int .Values.global.nodeCount }}
{{- range $i := until $nodeCount }}
"testacc{{ add $i 1 }}": {
"socketAddress": "{{ include "commonware-avs.node.fullname" $ }}-{{ add $i 1 }}:{{ add (int $.Values.node.basePort) $i }}"
}{{ if lt (add $i 1) $nodeCount }},{{ end }}
{{- end }}
}
}
{{- if .Values.orchestrator.publicConfig }}
# Public orchestrator config - optional override
# If not provided, will use the file from the image at /app/config/public_orchestrator.json
public_orchestrator.json: |
{{ .Values.orchestrator.publicConfig | indent 4 }}
{{- end }}
69 changes: 69 additions & 0 deletions helm/commonware-restaking/templates/ethereum-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{{- if and .Values.ethereum.enabled .Values.secrets.forkUrl }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "commonware-avs.ethereum.fullname" . }}
labels:
{{- include "commonware-avs.labels" . | nindent 4 }}
app.kubernetes.io/component: ethereum
spec:
replicas: 1
selector:
matchLabels:
{{- include "commonware-avs.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: ethereum
template:
metadata:
labels:
{{- include "commonware-avs.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: ethereum
spec:
# Prioritize keeping ethereum pod running - it holds critical state
priorityClassName: system-cluster-critical
containers:
- name: ethereum
image: "{{ .Values.ethereum.image.repository }}:{{ .Values.ethereum.image.tag }}"
imagePullPolicy: {{ .Values.ethereum.image.pullPolicy }}
env:
- name: FORK_URL
valueFrom:
secretKeyRef:
name: {{ include "commonware-avs.secret.fullname" . }}
key: FORK_URL
ports:
- name: rpc
containerPort: 8545
protocol: TCP
# Use TCP socket probe on the RPC port - more reliable than pgrep which may not exist in container
livenessProbe:
tcpSocket:
port: rpc
initialDelaySeconds: 60
periodSeconds: 30
failureThreshold: 5
readinessProbe:
tcpSocket:
port: rpc
initialDelaySeconds: 10
periodSeconds: 5
resources:
{{- toYaml .Values.ethereum.resources | nindent 12 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "commonware-avs.ethereum.fullname" . }}
labels:
{{- include "commonware-avs.labels" . | nindent 4 }}
app.kubernetes.io/component: ethereum
spec:
type: {{ .Values.ethereum.service.type }}
ports:
- port: {{ .Values.ethereum.service.port }}
targetPort: rpc
protocol: TCP
name: rpc
selector:
{{- include "commonware-avs.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: ethereum
{{- end }}
41 changes: 41 additions & 0 deletions helm/commonware-restaking/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "commonware-avs.fullname" . }}
labels:
{{- include "commonware-avs.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
service:
name: {{ include "commonware-avs.router.fullname" $ }}
port:
name: ingress
{{- end }}
{{- end }}
{{- end }}
Loading
Loading