From 068cc8066eddf8b0f4d6b6ce6eba1c501c300458 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Tue, 29 Oct 2019 20:22:25 +0200 Subject: [PATCH] Store the testnet metadata in the official eth2-clients repo [skip ci] --- scripts/connect_to_testnet.nims | 2 +- scripts/reset_testnet.sh | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/connect_to_testnet.nims b/scripts/connect_to_testnet.nims index c1a7e91a5..b079cedfd 100644 --- a/scripts/connect_to_testnet.nims +++ b/scripts/connect_to_testnet.nims @@ -7,7 +7,7 @@ const depositContractFile = "deposit_contract.txt" genesisFile = "genesis.ssz" configFile = "config.yaml" - clientsOrg = "zah" # "eth2-clients" + clientsOrg = "eth2-clients" testnetsRepo = "eth2-testnets" testnetsRepoGitUrl = "https://github.com/" & clientsOrg & "/" & testnetsRepo diff --git a/scripts/reset_testnet.sh b/scripts/reset_testnet.sh index d3e1bfaa2..a98e48f5e 100755 --- a/scripts/reset_testnet.sh +++ b/scripts/reset_testnet.sh @@ -34,7 +34,7 @@ while true; do done if [[ ! -d "$ETH2_TESTNETS" ]]; then - git clone git@github.com:zah/eth2-testnets "$ETH2_TESTNETS" + git clone git@github.com:eth2-clients/eth2-testnets "$ETH2_TESTNETS" fi ETH2_TESTNETS_ABS=$(cd "$ETH2_TESTNETS"; pwd) @@ -85,18 +85,14 @@ $DOCKER_BEACON_NODE \ $WEB3_URL_ARG $DEPOSIT_CONTRACT_ADDRESS_ARG \ --genesis-offset=60 # Delay in seconds +COMMITTED_FILES="genesis.ssz bootstrap_nodes.txt" + if [[ ! -z "$DEPOSIT_CONTRACT_ADDRESS" ]]; then echo $DEPOSIT_CONTRACT_ADDRESS > "$ETH2_TESTNETS_ABS/deposit_contract.txt" + COMMITTED_FILES+="deposit_contract.txt" fi if [[ $PUBLISH_TESTNET_RESETS != "0" ]]; then - echo Persisting testnet data to git... - pushd "$NETWORK_DIR_ABS" - git add genesis.ssz bootstrap_nodes.txt deposit_contract.txt - git commit -m "Reset of Nimbus $NETWORK_NAME" - git push - popd - echo Redistributing validator keys to server nodes... # TODO If we try to use direct piping here, bash doesn't execute all of the commands. # The reasons for this are unclear at the moment. @@ -117,4 +113,11 @@ if [[ $PUBLISH_TESTNET_RESETS != "0" ]]; then echo Publishing docker image... make push + + echo Persisting testnet data to git... + pushd "$NETWORK_DIR_ABS" + git add $COMMITTED_FILES + git commit -m "Reset of Nimbus $NETWORK_NAME" + git push + popd fi