From ddb8d67151aa86bbabc072fc04d1a2db05c1a7a2 Mon Sep 17 00:00:00 2001 From: Kasey Kirkham Date: Mon, 1 May 2023 14:15:38 -0500 Subject: [PATCH] wait for prysmctl to complete before geth genesis --- docker-compose.yml | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8540e45..8da3c13 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,22 @@ version: "3.9" services: + #Creates a genesis state for the beacon chain using a YAML configuration file and + # a deterministic set of 64 validators. + create-beacon-chain-genesis: + image: "gcr.io/prysmaticlabs/prysm/cmd/prysmctl:latest" + command: + - testnet + - generate-genesis + - --fork=bellatrix + - --num-validators=64 + - --output-ssz=/consensus/genesis.ssz + - --chain-config-file=/consensus/config.yml + - --geth-genesis-json-in=/execution/genesis.json + - --geth-genesis-json-out=/execution/genesis.json + volumes: + - ./consensus:/consensus + - ./execution:/execution + # Sets up the genesis configuration for the go-ethereum client from a JSON file. geth-genesis: image: "ethereum/client-go:latest" @@ -7,6 +24,10 @@ services: volumes: - ./execution:/execution - ./execution/genesis.json:/execution/genesis.json + depends_on: + create-beacon-chain-genesis: + condition: service_completed_successfully + # Runs the go-ethereum execution client with the specified, unlocked account and necessary # APIs to allow for proof-of-stake consensus via Prysm. geth: @@ -35,23 +56,6 @@ services: - ./execution/geth_password.txt:/execution/geth_password.txt - ./jwtsecret:/execution/jwtsecret - #Creates a genesis state for the beacon chain using a YAML configuration file and - # a deterministic set of 64 validators. - create-beacon-chain-genesis: - image: "gcr.io/prysmaticlabs/prysm/cmd/prysmctl:latest" - command: - - testnet - - generate-genesis - - --fork=bellatrix - - --num-validators=64 - - --output-ssz=/consensus/genesis.ssz - - --chain-config-file=/consensus/config.yml - - --geth-genesis-json-in=/execution/genesis.json - - --geth-genesis-json-out=/execution/genesis.json - volumes: - - ./consensus:/consensus - - ./execution:/execution - # Runs a Prysm beacon chain from a specified genesis state created in the previous step # and connects to go-ethereum in the same network as the execution client. # The account used in go-ethereum is set as the suggested fee recipient for transactions