diff --git a/container-build/cerc-fixturenet-eth-geth/Dockerfile b/container-build/cerc-fixturenet-eth-geth/Dockerfile index d3cf2f95..068291a2 100644 --- a/container-build/cerc-fixturenet-eth-geth/Dockerfile +++ b/container-build/cerc-fixturenet-eth-geth/Dockerfile @@ -1,7 +1,7 @@ FROM skylenet/ethereum-genesis-generator AS ethgen FROM cerc/go-ethereum:local -RUN apk add --no-cache python3 py3-pip curl wget jq build-base gettext libintl openssl bash +RUN apk add --no-cache python3 python3-dev py3-pip curl wget jq build-base gettext libintl openssl bash COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/eth2-testnet-genesis COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/eth2-val-tools diff --git a/container-build/cerc-fixturenet-eth-geth/genesis/accounts/mnemonic_to_csv.py b/container-build/cerc-fixturenet-eth-geth/genesis/accounts/mnemonic_to_csv.py index 730426bd..365c3775 100644 --- a/container-build/cerc-fixturenet-eth-geth/genesis/accounts/mnemonic_to_csv.py +++ b/container-build/cerc-fixturenet-eth-geth/genesis/accounts/mnemonic_to_csv.py @@ -12,6 +12,6 @@ if len(sys.argv) > 1: with open(testnet_config_path) as stream: data = yaml.safe_load(stream) -for key, value in data['eth1_premine'].items(): +for key, value in data['el_premine'].items(): acct = w3.eth.account.from_mnemonic(data['mnemonic'], account_path=key, passphrase='') print("%s,%s,%s" % (key, acct.address, acct.key.hex())) diff --git a/container-build/cerc-fixturenet-eth-geth/genesis/el/build_el.sh b/container-build/cerc-fixturenet-eth-geth/genesis/el/build_el.sh index 5eeeba51..0070707d 100755 --- a/container-build/cerc-fixturenet-eth-geth/genesis/el/build_el.sh +++ b/container-build/cerc-fixturenet-eth-geth/genesis/el/build_el.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -e # See: https://github.com/skylenet/ethereum-genesis-generator/blob/master/entrypoint.sh @@ -8,5 +9,7 @@ mkdir -p ../build/el tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX) envsubst < el-config.yaml > $tmp_dir/genesis-config.yaml -python3 /apps/el-gen/genesis_geth.py $tmp_dir/genesis-config.yaml > ../build/el/geth.json +ttd=`cat $tmp_dir/genesis-config.yaml | grep terminal_total_difficulty | awk '{ print $2 }'` + +python3 /apps/el-gen/genesis_geth.py $tmp_dir/genesis-config.yaml | jq ".config.terminalTotalDifficulty=$ttd" > ../build/el/geth.json python3 ../accounts/mnemonic_to_csv.py $tmp_dir/genesis-config.yaml > ../build/el/accounts.csv diff --git a/container-build/cerc-fixturenet-eth-geth/genesis/el/el-config.yaml b/container-build/cerc-fixturenet-eth-geth/genesis/el/el-config.yaml index 7beb9c80..ed8d4885 100644 --- a/container-build/cerc-fixturenet-eth-geth/genesis/el/el-config.yaml +++ b/container-build/cerc-fixturenet-eth-geth/genesis/el/el-config.yaml @@ -1,17 +1,16 @@ mnemonic: "viable ketchup woman library opinion copy rhythm attend rose knock penalty practice photo bundle budget dentist enter round bind holiday useful arch danger lobster" -eth1_premine: +el_premine: "m/44'/60'/0'/0/0": 10000000ETH "m/44'/60'/0'/0/1": 10000000ETH "m/44'/60'/0'/0/2": 10000000ETH "m/44'/60'/0'/0/3": 10000000ETH "m/44'/60'/0'/0/4": 10000000ETH "m/44'/60'/0'/0/5": 10000000ETH -eth1_premine_addrs: {} +el_premine_addrs: {} chain_id: 1212 deposit_contract_address: "0x1212121212121212121212121212121212121212" -eth1_genesis_timestamp: 0 -terminal_total_difficulty: 10000000 -mergeForkBlock: 100 +genesis_timestamp: 0 +terminal_total_difficulty: 1000 clique: enabled: false diff --git a/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/vars.env b/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/vars.env index 66fd8c8e..d68cbdcc 100644 --- a/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/vars.env +++ b/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/vars.env @@ -27,8 +27,8 @@ GENESIS_DELAY=${GENESIS_DELAY:-0} BOOTNODE_PORT=${BOOTNODE_PORT:-4242} # Hard fork configuration -ALTAIR_FORK_EPOCH=${ALTAIR_FORK_EPOCH:-1} -MERGE_FORK_EPOCH=${MERGE_FORK_EPOCH:-2} +ALTAIR_FORK_EPOCH=${ALTAIR_FORK_EPOCH:-0} +MERGE_FORK_EPOCH=${MERGE_FORK_EPOCH:-0} # Spec version (mainnet or minimal) SPEC_PRESET=${SPEC_PRESET:-mainnet} @@ -44,10 +44,11 @@ VC_ARGS=${VC_ARGS:-""} EXECUTION_ENDPOINT=${EXECUTION_ENDPOINT:-http://localhost:8551} +ETH1_GENESIS_JSON=${ETH1_GENESIS_JSON:-"../build/el/geth.json"} ETH1_CONFIG_YAML=${ETH1_CONFIG_YAML:-"../el/el-config.yaml"} -ETH1_CHAIN_ID=${ETH1_CHAIN_ID:-`cat $ETH1_CONFIG_YAML | grep 'chain_id' | awk '{ print $2 }'`} -ETH1_TTD=${ETH1_TTD:-`cat $ETH1_CONFIG_YAML | grep 'terminal_total_difficulty' | awk '{ print $2 }'`} +ETH1_CHAIN_ID=${ETH1_CHAIN_ID:-`cat $ETH1_GENESIS_JSON | jq -r '.config.chainId'`} +ETH1_TTD=${ETH1_TTD:-`cat $ETH1_GENESIS_JSON | jq -r '.config.terminalTotalDifficulty'`} ETH1_DEPOSIT_CONTRACT_ADDRESS=${ETH1_DEPOSIT_CONTRACT_ADDRESS:-`cat $ETH1_CONFIG_YAML | grep 'deposit_contract_address' | awk '{ print $2 }' | sed 's/"//g'`} ETH1_DEPOSIT_CONTRACT_BLOCK=${ETH1_DEPOSIT_CONTRACT_BLOCK:-0x0} SUGGESTED_FEE_RECIPIENT=`cat ../build/el/accounts.csv | head -1 | cut -d',' -f2` diff --git a/container-build/cerc-fixturenet-eth-lighthouse/run-cl.sh b/container-build/cerc-fixturenet-eth-lighthouse/run-cl.sh index 4d41f590..07346e58 100755 --- a/container-build/cerc-fixturenet-eth-lighthouse/run-cl.sh +++ b/container-build/cerc-fixturenet-eth-lighthouse/run-cl.sh @@ -9,14 +9,14 @@ if [ "true" == "$RUN_BOOTNODE" ]; then ./bootnode.sh 2>&1 | tee /var/log/lighthouse_bootnode.log else while [ 1 -eq 1 ]; do - echo "Waiting on DAG ..." + echo "Waiting on geth ..." sleep 5 result=`wget --no-check-certificate --quiet \ -O - \ --method POST \ --timeout=0 \ --header 'Content-Type: application/json' \ - --body-data '{ "jsonrpc": "2.0", "id": 1, "method": "eth_getBlockByNumber", "params": ["0x3", false] }' "${ETH1_ENDPOINT:-localhost:8545}" | jq -r '.result'` + --body-data '{ "jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": [] }' "${ETH1_ENDPOINT:-localhost:8545}" | jq -r '.result'` if [ ! -z "$result" ] && [ "null" != "$result" ]; then break fi diff --git a/container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh b/container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh index a9ef78e9..e02fc14b 100755 --- a/container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh +++ b/container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh @@ -1,6 +1,6 @@ #!/bin/bash -STATUSES=("geth to begin mining" "beacon phase0" "beacon altair" "beacon bellatrix pre-merge" "beacon bellatrix merge") +STATUSES=("geth to generate DAG" "beacon phase0" "beacon altair" "beacon bellatrix pre-merge" "beacon bellatrix merge") STATUS=0