Skip to content

Commit e6fa2ee

Browse files
committed
initial setup for the execution layer chain
1 parent 1ba8c4c commit e6fa2ee

File tree

6 files changed

+186
-1
lines changed

6 files changed

+186
-1
lines changed

starship/charts/devnet/defaults.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,17 @@ defaultChains:
793793
exponent: 6
794794
coingecko_id: stake
795795
keywords: [ "stake" ]
796+
etherum-execution:
797+
image: ghcr.io/cosmology-tech/starship/ethereum/client-go:latest
798+
home: /ethereum/execution
799+
binary: geth
800+
prefix: eth
801+
denom: ueth
802+
prettyName: Ethereum Execution Chain
803+
coins: 100000000000000eth
804+
hdPath: m/44'/60'/0'/0/0
805+
coinType: 60
806+
repo: https://github.com/ethereum/go-ethereum
796807
eth:
797808
storageClassName: hostpath
798809
genesisStateUrl: https://github.com/eth-clients/merge-testnets/blob/main/sepolia/genesis.ssz
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{- range $chain := .Values.chains }}
2+
{{- if hasPrefix "ethereum" $chain.name }}
3+
---
4+
apiVersion: v1
5+
kind: ConfigMap
6+
metadata:
7+
name: genesis-{{ $chain.name }}
8+
data:
9+
genesis.json: |-
10+
{
11+
"config": {
12+
"chainId": 1337,
13+
"homesteadBlock": 0,
14+
"eip150Block": 0,
15+
"eip155Block": 0,
16+
"eip158Block": 0,
17+
"byzantiumBlock": 0,
18+
"constantinopleBlock": 0,
19+
"petersburgBlock": 0,
20+
"istanbulBlock": 0
21+
},
22+
"difficulty": "0x1",
23+
"gasLimit": "0x47b760",
24+
"alloc": {
25+
"0x0000000000000000000000000000000000000001": {
26+
"balance": "0xde0b6b3a7640000"
27+
}
28+
}
29+
}
30+
---
31+
{{- end }}
32+
{{- end }}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{{- range $chain := .Values.chains }}
2+
{{- if hasPrefix "ethereum-execution" $chain.name }}
3+
{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }}
4+
5+
{{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }}
6+
---
7+
apiVersion: apps/v1
8+
kind: StatefulSet
9+
metadata:
10+
name: {{ $chain.name }}-execution-chain
11+
namespace: {{ $.Release.Namespace }}
12+
labels:
13+
app: {{ $chain.name }}-execution-chain
14+
spec:
15+
serviceName: {{ $chain.name }}-execution-chain
16+
replicas: {{ $chain.replicas }}
17+
selector:
18+
matchLabels:
19+
app.kubernetes.io/instance: {{ $chain.name }}
20+
app.kubernetes.io/name: {{ $chain.id }}-genesis
21+
template:
22+
metadata:
23+
annotations:
24+
quality: release
25+
role: api-gateway
26+
sla: high
27+
tier: gateway
28+
labels:
29+
app.kubernetes.io/instance: {{ $chain.name }}
30+
app.kubernetes.io/type: {{ $chain.id }}
31+
app.kubernetes.io/name: {{ $chain.id }}-genesis
32+
app.kubernetes.io/rawname: {{ $chain.id }}
33+
app.kubernetes.io/version: {{ $.Chart.AppVersion }}
34+
spec:
35+
{{- include "imagePullSecrets" $chain | indent 6 }}
36+
initContainers:
37+
- name: init-genesis
38+
image: {{ $chain.image }}
39+
imagePullPolicy: IfNotPresent
40+
command:
41+
- bash
42+
- "-c"
43+
- |
44+
echo "Initializing genesis"
45+
cp /genesis/genesis.json /ethereum/execution/genesis.json
46+
geth --datadir /ethereum/execution init /ethereum/execution/genesis.json
47+
resources: {{- include "devnet.node.resources" ( dict "node" $chain "context" $ ) | trim | nindent 12 }}
48+
volumeMounts:
49+
- name: genesis
50+
mountPath: /genesis
51+
- name: ethereum
52+
mountPath: /ethereum/execution
53+
containers:
54+
- name: node
55+
image: {{ $chain.image }}
56+
imagePullPolicy: IfNotPresent
57+
env:
58+
- name: NETWORK
59+
value: {{ $chain.network }}
60+
- name: LOG_LEVEL
61+
value: {{ $chain.logLevel }}
62+
- name: DATA_DIR
63+
value: {{ $chain.dataDir }}
64+
- name: HTTP_PORT
65+
value: "8545"
66+
- name: WS_PORT
67+
value: "8546"
68+
- name: RPC_PORT
69+
value: "8551"
70+
command:
71+
- bash
72+
- "-c"
73+
- |
74+
echo "Starting execution chain"
75+
geth --datadir /ethereum/execution --http \
76+
--http.addr=0.0.0.0 \
77+
--http.port=$HTTP_PORT \
78+
--http.api=eth,net,web3,debug \
79+
--ws --ws.addr=0.0.0.0 \
80+
--ws.port=$WS_PORT \
81+
--authrpc.port=$RPC_PORT \
82+
--nodiscover \
83+
--http.corsdomain=* \
84+
--ws.api=eth,net,web3 \
85+
--ws.origins=* \
86+
--http.vhosts=* \
87+
--authrpc.vhosts=* \
88+
--authrpc.jwtsecret=/etc/secrets/jwt.hex \
89+
--allow-insecure-unlock \
90+
--unlock=0x123463a4B065722E99115D6c222f267d9cABb524 \
91+
--password=/dev/null \
92+
--syncmode=full \
93+
--networkid=32382
94+
resources: {{- include "devnet.node.resources" ( dict "node" $chain "context" $ ) | trim | nindent 12 }}
95+
volumeMounts:
96+
- name: ethereum
97+
mountPath: /ethereum/execution
98+
volumes:
99+
- name: genesis
100+
configMap:
101+
name: genesis-{{ $chain.name }}
102+
- name: ethereum
103+
emptyDir: { }
104+
---
105+
{{- end }}
106+
{{- end }}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{ $portMap := dict "http" 8545 "ws" 8546 "rpc" 8551 }}
2+
{{- range $chain := .Values.chains }}
3+
{{- if hasPrefix "ethereum-beacon" $chain.name }}
4+
{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }}
5+
6+
{{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }}
7+
---
8+
apiVersion: v1
9+
kind: Service
10+
metadata:
11+
name: {{ $chain.name }}
12+
labels:
13+
app.kubernetes.io/name: {{ $chain.name }}
14+
spec:
15+
clusterIP: None
16+
ports:
17+
{{- range $name, $port := $portMap }}
18+
- name: {{ $name }}
19+
port: {{ $port }}
20+
protocol: TCP
21+
targetPort: {{ $port }}
22+
{{- end }}
23+
selector:
24+
app.kubernetes.io/name: {{ $chain.name }}
25+
---
26+
{{- end }}
27+
{{- end }}

starship/charts/devnet/values.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@
146146
"agoric",
147147
"kujira",
148148
"hyperweb",
149-
"noble"
149+
"noble",
150+
"ethereum-execution"
150151
]
151152
},
152153
"numValidators": {

starship/tests/e2e/configs/eth.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
chains:
2+
- id: ethereum-execution
3+
name: ethereum-execution
4+
image: ghcr.io/cosmology-tech/starship/ethereum/client-go:latest
5+
numValidators: 1
6+
ports:
7+
rest: 8545
8+
rpc: 8551

0 commit comments

Comments
 (0)