diff --git a/starship/charts/devnet/defaults.yaml b/starship/charts/devnet/defaults.yaml index b8e04510..fbbf45ee 100644 --- a/starship/charts/devnet/defaults.yaml +++ b/starship/charts/devnet/defaults.yaml @@ -793,6 +793,17 @@ defaultChains: exponent: 6 coingecko_id: stake keywords: [ "stake" ] + etherum-execution: + image: ghcr.io/cosmology-tech/starship/ethereum/client-go:latest + home: /ethereum/execution + binary: geth + prefix: eth + denom: ueth + prettyName: Ethereum Execution Chain + coins: 100000000000000eth + hdPath: m/44'/60'/0'/0/0 + coinType: 60 + repo: https://github.com/ethereum/go-ethereum eth: storageClassName: hostpath genesisStateUrl: https://github.com/eth-clients/merge-testnets/blob/main/sepolia/genesis.ssz diff --git a/starship/charts/devnet/templates/chains/eth/configmap.yaml b/starship/charts/devnet/templates/chains/eth/configmap.yaml index e69de29b..0036ed38 100644 --- a/starship/charts/devnet/templates/chains/eth/configmap.yaml +++ b/starship/charts/devnet/templates/chains/eth/configmap.yaml @@ -0,0 +1,32 @@ +{{- range $chain := .Values.chains }} +{{- if hasPrefix "ethereum" $chain.name }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: genesis-{{ $chain.name }} +data: + genesis.json: |- + { + "config": { + "chainId": 1337, + "homesteadBlock": 0, + "eip150Block": 0, + "eip155Block": 0, + "eip158Block": 0, + "byzantiumBlock": 0, + "constantinopleBlock": 0, + "petersburgBlock": 0, + "istanbulBlock": 0 + }, + "difficulty": "0x1", + "gasLimit": "0x47b760", + "alloc": { + "0x0000000000000000000000000000000000000001": { + "balance": "0xde0b6b3a7640000" + } + } + } +--- +{{- end }} +{{- end }} diff --git a/starship/charts/devnet/templates/chains/eth/genesis.yaml b/starship/charts/devnet/templates/chains/eth/genesis.yaml index e69de29b..aeb51800 100644 --- a/starship/charts/devnet/templates/chains/eth/genesis.yaml +++ b/starship/charts/devnet/templates/chains/eth/genesis.yaml @@ -0,0 +1,106 @@ +{{- range $chain := .Values.chains }} +{{- if hasPrefix "ethereum-execution" $chain.name }} +{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} + +{{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }} +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ $chain.name }}-execution-chain + namespace: {{ $.Release.Namespace }} + labels: + app: {{ $chain.name }}-execution-chain +spec: + serviceName: {{ $chain.name }}-execution-chain + replicas: {{ $chain.replicas }} + selector: + matchLabels: + app.kubernetes.io/instance: {{ $chain.name }} + app.kubernetes.io/name: {{ $chain.id }}-genesis + template: + metadata: + annotations: + quality: release + role: api-gateway + sla: high + tier: gateway + labels: + app.kubernetes.io/instance: {{ $chain.name }} + app.kubernetes.io/type: {{ $chain.id }} + app.kubernetes.io/name: {{ $chain.id }}-genesis + app.kubernetes.io/rawname: {{ $chain.id }} + app.kubernetes.io/version: {{ $.Chart.AppVersion }} + spec: + {{- include "imagePullSecrets" $chain | indent 6 }} + initContainers: + - name: init-genesis + image: {{ $chain.image }} + imagePullPolicy: IfNotPresent + command: + - bash + - "-c" + - | + echo "Initializing genesis" + cp /genesis/genesis.json /ethereum/execution/genesis.json + geth --datadir /ethereum/execution init /ethereum/execution/genesis.json + resources: {{- include "devnet.node.resources" ( dict "node" $chain "context" $ ) | trim | nindent 12 }} + volumeMounts: + - name: genesis + mountPath: /genesis + - name: ethereum + mountPath: /ethereum/execution + containers: + - name: node + image: {{ $chain.image }} + imagePullPolicy: IfNotPresent + env: + - name: NETWORK + value: {{ $chain.network }} + - name: LOG_LEVEL + value: {{ $chain.logLevel }} + - name: DATA_DIR + value: {{ $chain.dataDir }} + - name: HTTP_PORT + value: "8545" + - name: WS_PORT + value: "8546" + - name: RPC_PORT + value: "8551" + command: + - bash + - "-c" + - | + echo "Starting execution chain" + geth --datadir /ethereum/execution --http \ + --http.addr=0.0.0.0 \ + --http.port=$HTTP_PORT \ + --http.api=eth,net,web3,debug \ + --ws --ws.addr=0.0.0.0 \ + --ws.port=$WS_PORT \ + --authrpc.port=$RPC_PORT \ + --nodiscover \ + --http.corsdomain=* \ + --ws.api=eth,net,web3 \ + --ws.origins=* \ + --http.vhosts=* \ + --authrpc.vhosts=* \ + --authrpc.jwtsecret=/etc/secrets/jwt.hex \ + --allow-insecure-unlock \ + --unlock=0x123463a4B065722E99115D6c222f267d9cABb524 \ + --password=/dev/null \ + --syncmode=full \ + --networkid=32382 + resources: {{- include "devnet.node.resources" ( dict "node" $chain "context" $ ) | trim | nindent 12 }} + volumeMounts: + - name: ethereum + mountPath: /ethereum/execution + volumes: + - name: genesis + configMap: + name: genesis-{{ $chain.name }} + - name: ethereum + emptyDir: { } +--- +{{- end }} +{{- end }} \ No newline at end of file diff --git a/starship/charts/devnet/templates/chains/eth/service.yaml b/starship/charts/devnet/templates/chains/eth/service.yaml index e69de29b..2aa3f4db 100644 --- a/starship/charts/devnet/templates/chains/eth/service.yaml +++ b/starship/charts/devnet/templates/chains/eth/service.yaml @@ -0,0 +1,27 @@ +{{ $portMap := dict "http" 8545 "ws" 8546 "rpc" 8551 }} +{{- range $chain := .Values.chains }} +{{- if hasPrefix "ethereum-beacon" $chain.name }} +{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} + +{{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ $chain.name }} + labels: + app.kubernetes.io/name: {{ $chain.name }} +spec: + clusterIP: None + ports: + {{- range $name, $port := $portMap }} + - name: {{ $name }} + port: {{ $port }} + protocol: TCP + targetPort: {{ $port }} + {{- end }} + selector: + app.kubernetes.io/name: {{ $chain.name }} +--- +{{- end }} +{{- end }} diff --git a/starship/charts/devnet/values.schema.json b/starship/charts/devnet/values.schema.json index 327f27b8..063babf7 100644 --- a/starship/charts/devnet/values.schema.json +++ b/starship/charts/devnet/values.schema.json @@ -146,7 +146,8 @@ "agoric", "kujira", "hyperweb", - "noble" + "noble", + "ethereum-execution" ] }, "numValidators": { diff --git a/starship/tests/e2e/configs/eth.yaml b/starship/tests/e2e/configs/eth.yaml new file mode 100644 index 00000000..f403ae36 --- /dev/null +++ b/starship/tests/e2e/configs/eth.yaml @@ -0,0 +1,8 @@ +chains: + - id: ethereum-execution + name: ethereum-execution + image: ghcr.io/cosmology-tech/starship/ethereum/client-go:latest + numValidators: 1 + ports: + rest: 8545 + rpc: 8551