Skip to content

Commit

Permalink
Parameterize eth chain (#161)
Browse files Browse the repository at this point in the history
* Sepolia support

* Update the geth version

* Parameterize storage

* Open p2p ports for geth

* Don't init genesis when joining an eth network

* Parameterize enablement of a validator

* Don't expose p2p ports

* Remove debugging statement

* Removed `network` value
  • Loading branch information
Inkvi committed Aug 8, 2023
1 parent 056d085 commit 47e2c16
Show file tree
Hide file tree
Showing 2 changed files with 287 additions and 24 deletions.
42 changes: 18 additions & 24 deletions charts/devnet/templates/chains/virtual/eth/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
{{ $defaultChain := get $defaultFile.defaultChains $chain.subtype | default dict }}
{{ $chain = merge $chain $defaultChain }}


apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand All @@ -31,7 +30,7 @@ spec:
rm -rf /ethereum/{execution,consensus}; \
mkdir -p /ethereum/consensus/{beacon,validator} /ethereum/execution \
&& cd /ethereum/consensus; \
stat genesis.ssz || wget -S https://github.com/eth-clients/eth2-networks/raw/master/shared/prater/genesis.ssz"]
stat genesis.ssz || wget -S {{ $chain.genesisStateUrl }};" ]
volumeMounts:
- name: ethereum
mountPath: /ethereum
Expand All @@ -41,6 +40,7 @@ spec:
volumeMounts:
- name: ethereum
mountPath: /ethereum
{{- if not $chain.joinNetwork }}
- name: prysm-beacon-init
image: {{ $chain.prysmCtl.image }}
command: {{ $chain.prysmCtl.command }}
Expand All @@ -54,23 +54,24 @@ spec:
- name: config
mountPath: /etc/config
readOnly: true
- name: geth-account-init
- name: geth-genesis-init
image: {{ $chain.geth.image }}
command: ['sh', '-c', "if [ -e /ethereum/.init ]; then exit 0; fi; geth --datadir=/ethereum/execution account import --password /dev/null /etc/secrets/secret.json"]
command: ['sh', '-c', "if [ -e /ethereum/.init ]; then exit 0; fi; geth init --datadir=/ethereum/execution /etc/config/genesis.json"]
volumeMounts:
- name: ethereum
mountPath: /ethereum
- name: secrets
mountPath: /etc/secrets
- name: config
mountPath: /etc/config
readOnly: true
- name: geth-genesis-init
{{- end }}
- name: geth-account-init
image: {{ $chain.geth.image }}
command: ['sh', '-c', "if [ -e /ethereum/.init ]; then exit 0; fi; geth init --datadir=/ethereum/execution /etc/config/genesis.json"]
command: ['sh', '-c', "if [ -e /ethereum/.init ]; then exit 0; fi; geth --datadir=/ethereum/execution account import --password /dev/null /etc/secrets/secret.json"]
volumeMounts:
- name: ethereum
mountPath: /ethereum
- name: config
mountPath: /etc/config
- name: secrets
mountPath: /etc/secrets
readOnly: true
- name: init-done
image: alpine/openssl
Expand All @@ -97,10 +98,7 @@ spec:
- name: secrets
mountPath: /etc/secrets
readOnly: true
resources:
requests:
cpu: 100m
memory: 1Gi
resources: {{- include "getResourceObject" $chain.geth.resources | trim | nindent 12 }}
- name: beacon-chain
image: {{ $chain.beaconChain.image }}
command: {{ $chain.beaconChain.command }}
Expand All @@ -125,10 +123,8 @@ spec:
- name: secrets
mountPath: /etc/secrets
readOnly: true
resources:
requests:
cpu: 100m
memory: 1Gi
resources: {{- include "getResourceObject" $chain.beaconChain.resources | trim | nindent 12 }}
{{- if $chain.validator.enabled }}
- name: validator
image: {{ $chain.validator.image }}
command: {{ $chain.validator.command }}
Expand All @@ -143,10 +139,8 @@ spec:
- name: config
mountPath: /etc/config
readOnly: true
resources:
requests:
cpu: 100m
memory: 1Gi
resources: {{- include "getResourceObject" $chain.beaconChain.resources | trim | nindent 12 }}
{{- end }}
{{- include "imagePullSecrets" $chain | indent 6 }}
volumes:
- name: secrets
Expand All @@ -160,10 +154,10 @@ spec:
name: ethereum
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: hostpath
storageClassName: {{ $chain.storageClassName }}
resources:
requests:
storage: 10Gi
storage: {{ $chain.storage }}

{{- end }}
{{- end }}
Expand Down
269 changes: 269 additions & 0 deletions charts/devnet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,275 @@ timeouts:
timeout_precommit_delta: 400ms
timeout_commit: 800ms

# API for interacting with the charts for devnet
# TODO: need a way to create state reaching jobs, those will run user bash scripts
# after the chain has been initialized, get the chain to a state and then complete
defaultChains:
osmosis:
image: ghcr.io/cosmology-tech/starship/osmosis:v15.1.2-wasmvm1.1.2
home: /root/.osmosisd
binary: osmosisd
prefix: osmo
denom: uosmo
coins: 100000000000000uosmo,100000000000000uion
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/osmosis-labs/osmosis
juno:
image: ghcr.io/cosmology-tech/starship/juno:v15.0.0
home: /root/.juno
binary: junod
prefix: juno
denom: ujuno
coins: 100000000000000ujuno
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/CosmosContracts/juno
wasmd:
image: anmol1696/wasmd:latest
home: /root/.wasmd
binary: wasmd
prefix: wasm
denom: stake
coins: 100000000000000ucosm,100000000000000stake
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/CosmWasm/wasmd
cosmos:
image: ghcr.io/cosmology-tech/starship/gaia:v9.1.1
home: /root/.gaia
binary: gaiad
prefix: cosmos
denom: uatom
coins: 100000000000000stake,100000000000000uatom
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/cosmos/gaia
simapp:
image: ghcr.io/cosmology-tech/starship/simapp:v0.47.3
home: /root/.simapp
binary: simd
prefix: cosmos
denom: stake
coins: 100000000000000stake
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/cosmos/cosmos-sdk/tree/main/simapp
persistencecore:
image: anmol1696/persistencecore:latest
home: /root/.persistenceCore
binary: persistenceCore
prefix: persistence
denom: uxprt
coins: 100000000000000uxprt
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/persistenceOne/persistenceCore
stride:
image: ghcr.io/cosmology-tech/starship/stride:v9.2.1
home: /root/.stride
binary: strided
prefix: stride
denom: ustrd
coins: 100000000000000ustrd
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/Stride-Labs/stride
injective:
image: ghcr.io/cosmology-tech/starship/injective:v1.11-1685225746
home: /root/.injectived
binary: injectived
prefix: inj
denom: inj
coins: 100000000000000inj
hdPath: m/44'/60'/0'/0/0
coinType: 60
repo: https://github.com/InjectiveLabs/injective-chain-releases
ics:
image: ghcr.io/cosmology-tech/starship/ics:v0.1.0
home: /root/.ics
binary: interchain-security-pd
prefix: cosmos
denom: uatom
coins: 100000000000000stake,100000000000000uatom
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/cosmos/interchain-security
cronos:
image: ghcr.io/cosmology-tech/starship/cronos:v1.0.4
home: /root/.cronos
binary: cronosd
prefix: crc
denom: basecro
coins: 100000000000000basecro
hdPath: m/44'/60'/0'/0/0
coinType: 60
repo: https://github.com/crypto-org-chain/cronos
cryptoorgchain:
image: ghcr.io/cosmology-tech/starship/cryptoorgchain:v4.1.2
home: /root/.cryptoorgchain
binary: chain-maind
prefix: cro
denom: basecro
coins: 100000000000000basecro
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/crypto-org-chain/chain-main
evmos:
image: ghcr.io/cosmology-tech/starship/evmos:v12.1.5
home: /root/.evmosd
binary: evmosd
prefix: evmos
denom: aevmos
coins: 100000000000000aevmos
hdPath: m/44'/60'/0'/0/0
coinType: 60
repo: https://github.com/evmos/evmos
regen:
image: ghcr.io/cosmology-tech/starship/regen:v5.0.0
home: /root/.regen
binary: regen
prefix: regen
denom: uregen
coins: 100000000000000uregen
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/regen-network/regen-ledger
quasar:
image: ghcr.io/cosmology-tech/starship/quasar:v0.1.1
home: /root/.quasarnode
binary: quasarnoded
prefix: quasar
denom: uqsr
coins: 100000000000000uqsr
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/quasar-finance/quasar-preview
quicksilver:
image: ghcr.io/cosmology-tech/starship/quicksilver:v0.6.6
home: /root/.quicksilverd
binary: quicksilverd
prefix: quick
denom: uqck
coins: 100000000000000uqck
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/ingenuity-build/quicksilver
sei:
image: ghcr.io/cosmology-tech/starship/sei:2.0.46beta
home: /root/.seid
binary: seid
prefix: sei
denom: usei
coins: 100000000000000usei
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/sei-protocol/sei-chain
sommelier:
image: ghcr.io/cosmology-tech/starship/sommelier:v6.0.0
home: /root/.sommelier
binary: sommelier
prefix: somm
denom: usomm
coins: 100000000000000usomm
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/PeggyJV/sommelier
stargaze:
image: ghcr.io/cosmology-tech/starship/stargaze:v10.0.1
home: /root/.starsd
binary: starsd
prefix: stars
denom: ustars
coins: 100000000000000ustars
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/public-awesome/stargaze
umee:
image: ghcr.io/cosmology-tech/starship/umee:v3.1.0
home: /root/.umee
binary: umeed
prefix: umee
denom: uumee
coins: 100000000000000uumee
hdPath: m/44'/118'/0'/0/0
coinType: 118
repo: https://github.com/umee-network/umee
eth:
storageClassName: hostpath
genesisStateUrl: https://github.com/eth-clients/merge-testnets/blob/main/sepolia/genesis.ssz
joinNetwork: false
prysmCtl:
image: gcr.io/prysmaticlabs/prysm/cmd/prysmctl
command: ["/app/cmd/prysmctl/prysmctl"]
args:
- testnet
- generate-genesis
- --num-validators=36
- --output-ssz=/ethereum/consensus/genesis.ssz
- --chain-config-file=/etc/config/config.yml
geth:
image: ethereum/client-go:v1.12.0
args:
- --nodiscover
- --http
- --http.api=eth,net,web3,debug
- --http.addr=0.0.0.0
- --http.vhosts=*
- --authrpc.addr=0.0.0.0
- --authrpc.jwtsecret=/etc/secrets/jwt.hex
- --datadir=/ethereum/execution
- --allow-insecure-unlock
- --unlock=0x123463a4B065722E99115D6c222f267d9cABb524
- --password=/dev/null
- --syncmode=full
- --mine
- --miner.etherbase=0x123463a4b065722e99115d6c222f267d9cabb524
- --networkid=32382
beaconChain:
image: gcr.io/prysmaticlabs/prysm/beacon-chain:v4.0.7
command: ["/app/cmd/beacon-chain/beacon-chain"]
args:
- --datadir=/ethereum/consensus/beacon
- --min-sync-peers=0
- --genesis-state=/ethereum/consensus/genesis.ssz
- --bootstrap-node=
- --chain-config-file=/etc/config/config.yml
- --config-file=/etc/config/config.yml
- --chain-id=32382
- --rpc-host=0.0.0.0
- --contract-deployment-block=0
- --grpc-gateway-host=0.0.0.0
- --execution-endpoint=http://localhost:8551
- --accept-terms-of-use
- --jwt-secret=/etc/secrets/jwt.hex
- --contract-deployment-block=0
- --suggested-fee-recipient=0x123463a4B065722E99115D6c222f267d9cABb524
validator:
enabled: false
image: gcr.io/prysmaticlabs/prysm/validator:v4.0.7
command: ["/app/cmd/validator/validator"]
args:
- --accept-terms-of-use
- --beacon-rpc-provider=localhost:4000
- --datadir=/ethereum/consensus/validator
- --interop-num-validators=36
- --interop-start-index=0
- --force-clear-db
- --chain-config-file=/etc/config/config.yml
- --config-file=/etc/config/config.yml
- --suggested-fee-recipient=0x0C46c2cAFE097b4f7e1BB868B89e5697eE65f934
contracts: []


defaultRelayers:
ts-relayer:
image: ghcr.io/cosmology-tech/starship/ts-relayer:0.9.0
hermes:
image: ghcr.io/cosmology-tech/starship/hermes:1.5.1
go-relayer:
image: ghcr.io/polymerdao/relayer-ibcx:starship-integration

chains: []
# Examples running chains
# - name: osmosis-1
Expand Down

0 comments on commit 47e2c16

Please sign in to comment.