Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add initial setup for eth #595

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
11 changes: 11 additions & 0 deletions starship/charts/devnet/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 32 additions & 0 deletions starship/charts/devnet/templates/chains/eth/configmap.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
106 changes: 106 additions & 0 deletions starship/charts/devnet/templates/chains/eth/genesis.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
27 changes: 27 additions & 0 deletions starship/charts/devnet/templates/chains/eth/service.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Empty file.
3 changes: 2 additions & 1 deletion starship/charts/devnet/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@
"agoric",
"kujira",
"hyperweb",
"noble"
"noble",
"ethereum-execution"
]
},
"numValidators": {
Expand Down
8 changes: 8 additions & 0 deletions starship/tests/e2e/configs/eth.yaml
Original file line number Diff line number Diff line change
@@ -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