From 22077dedc8979816298a242fae28e256125a0e51 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Sat, 28 Jan 2023 00:51:11 -0600 Subject: [PATCH] Remove generated files. Former-commit-id: d0c506af881fee53f174f6d8380c1e2b36cdc3d6 --- .../cerc-datanet-eth-geth/build/Dockerfile | 27 ----- .../cerc-datanet-eth-geth/build/build.sh | 6 -- .../build/genesis/Makefile | 13 --- .../build/genesis/accounts/import_keys.sh | 17 ---- .../build/genesis/accounts/mnemonic_to_csv.py | 17 ---- .../build/genesis/el/build_el.sh | 55 ----------- .../build/genesis/el/el-config.yaml | 31 ------ .../cerc-datanet-eth-geth/build/run-el.sh | 99 ------------------- 8 files changed, 265 deletions(-) delete mode 100644 app/data/container-build/cerc-datanet-eth-geth/build/Dockerfile delete mode 100755 app/data/container-build/cerc-datanet-eth-geth/build/build.sh delete mode 100644 app/data/container-build/cerc-datanet-eth-geth/build/genesis/Makefile delete mode 100755 app/data/container-build/cerc-datanet-eth-geth/build/genesis/accounts/import_keys.sh delete mode 100644 app/data/container-build/cerc-datanet-eth-geth/build/genesis/accounts/mnemonic_to_csv.py delete mode 100755 app/data/container-build/cerc-datanet-eth-geth/build/genesis/el/build_el.sh delete mode 100644 app/data/container-build/cerc-datanet-eth-geth/build/genesis/el/el-config.yaml delete mode 100755 app/data/container-build/cerc-datanet-eth-geth/build/run-el.sh diff --git a/app/data/container-build/cerc-datanet-eth-geth/build/Dockerfile b/app/data/container-build/cerc-datanet-eth-geth/build/Dockerfile deleted file mode 100644 index 51dbbcd4..00000000 --- a/app/data/container-build/cerc-datanet-eth-geth/build/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen - -# Using the same golang image as used to build geth: https://github.com/cerc-io/go-ethereum/blob/HEAD/Dockerfile -FROM golang:1.18-alpine as delve -RUN go install github.com/go-delve/delve/cmd/dlv@latest - -FROM cerc/go-ethereum:local as geth - -FROM alpine:latest -RUN apk add --no-cache python3 python3-dev py3-pip curl wget jq build-base gettext libintl openssl bash bind-tools postgresql-client - -COPY --from=delve /go/bin/dlv /usr/local/bin/ -COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/ -COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/ -COPY --from=ethgen /apps /apps - -RUN cd /apps/el-gen && pip3 install -r requirements.txt - -COPY genesis /opt/testnet -COPY run-el.sh /opt/testnet/run.sh - -RUN cd /opt/testnet && make genesis-el - -COPY --from=geth /usr/local/bin/geth /usr/local/bin/ -RUN geth init /opt/testnet/build/el/geth.json && rm -f ~/.ethereum/geth/nodekey - -ENTRYPOINT ["/opt/testnet/run.sh"] diff --git a/app/data/container-build/cerc-datanet-eth-geth/build/build.sh b/app/data/container-build/cerc-datanet-eth-geth/build/build.sh deleted file mode 100755 index b06044c7..00000000 --- a/app/data/container-build/cerc-datanet-eth-geth/build/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -# Build cerc/fixturenet-eth-geth - -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -docker build -t cerc/fixturenet-eth-geth:local -f ${SCRIPT_DIR}/Dockerfile $SCRIPT_DIR diff --git a/app/data/container-build/cerc-datanet-eth-geth/build/genesis/Makefile b/app/data/container-build/cerc-datanet-eth-geth/build/genesis/Makefile deleted file mode 100644 index a1eef575..00000000 --- a/app/data/container-build/cerc-datanet-eth-geth/build/genesis/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -.PHONY: build -build: genesis - -.PHONY: genesis -genesis: genesis-el - -.PHONY: genesis-el -genesis-el: - cd el; ./build_el.sh - -.PHONY: clean -clean: - rm -rf build diff --git a/app/data/container-build/cerc-datanet-eth-geth/build/genesis/accounts/import_keys.sh b/app/data/container-build/cerc-datanet-eth-geth/build/genesis/accounts/import_keys.sh deleted file mode 100755 index 719b9f59..00000000 --- a/app/data/container-build/cerc-datanet-eth-geth/build/genesis/accounts/import_keys.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -ACCOUNT_PASSWORD=${ACCOUNT_PASSWORD:-secret1212} - -for line in `cat ../build/el/accounts.csv`; do - BIP44_PATH="`echo "$line" | cut -d',' -f1`" - ADDRESS="`echo "$line" | cut -d',' -f2`" - PRIVATE_KEY="`echo "$line" | cut -d',' -f3`" - - echo "$ACCOUNT_PASSWORD" > .pw.$$ - echo "$PRIVATE_KEY" | sed 's/0x//' > .key.$$ - - echo "" - echo "$ADDRESS" - geth account import --password .pw.$$ .key.$$ - rm -f .pw.$$ .key.$$ -done diff --git a/app/data/container-build/cerc-datanet-eth-geth/build/genesis/accounts/mnemonic_to_csv.py b/app/data/container-build/cerc-datanet-eth-geth/build/genesis/accounts/mnemonic_to_csv.py deleted file mode 100644 index 365c3775..00000000 --- a/app/data/container-build/cerc-datanet-eth-geth/build/genesis/accounts/mnemonic_to_csv.py +++ /dev/null @@ -1,17 +0,0 @@ -from web3.auto import w3 -import json -import ruamel.yaml as yaml -import sys - -w3.eth.account.enable_unaudited_hdwallet_features() - -testnet_config_path = "genesis-config.yaml" -if len(sys.argv) > 1: - testnet_config_path = sys.argv[1] - -with open(testnet_config_path) as stream: - data = yaml.safe_load(stream) - -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/app/data/container-build/cerc-datanet-eth-geth/build/genesis/el/build_el.sh b/app/data/container-build/cerc-datanet-eth-geth/build/genesis/el/build_el.sh deleted file mode 100755 index d52892b8..00000000 --- a/app/data/container-build/cerc-datanet-eth-geth/build/genesis/el/build_el.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env bash -set -e - -# See: https://github.com/skylenet/ethereum-genesis-generator/blob/master/entrypoint.sh - -rm -rf ../build/el -mkdir -p ../build/el - -tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX) -envsubst < el-config.yaml > $tmp_dir/genesis-config.yaml - -ttd=`cat $tmp_dir/genesis-config.yaml | grep terminal_total_difficulty | awk '{ print $2 }'` -homestead_block=`cat $tmp_dir/genesis-config.yaml | grep homestead_block | awk '{ print $2 }'` -eip150_block=`cat $tmp_dir/genesis-config.yaml | grep eip150_block | awk '{ print $2 }'` -eip155_block=`cat $tmp_dir/genesis-config.yaml | grep eip155_block | awk '{ print $2 }'` -eip158_block=`cat $tmp_dir/genesis-config.yaml | grep eip158_block | awk '{ print $2 }'` -byzantium_block=`cat $tmp_dir/genesis-config.yaml | grep byzantium_block | awk '{ print $2 }'` -constantinople_block=`cat $tmp_dir/genesis-config.yaml | grep constantinople_block | awk '{ print $2 }'` -petersburg_block=`cat $tmp_dir/genesis-config.yaml | grep petersburg_block | awk '{ print $2 }'` -istanbul_block=`cat $tmp_dir/genesis-config.yaml | grep istanbul_block | awk '{ print $2 }'` -berlin_block=`cat $tmp_dir/genesis-config.yaml | grep berlin_block | awk '{ print $2 }'` -london_block=`cat $tmp_dir/genesis-config.yaml | grep london_block | awk '{ print $2 }'` -merge_fork_block=`cat $tmp_dir/genesis-config.yaml | grep merge_fork_block | awk '{ print $2 }'` -capped_maximum_difficulty=`cat $tmp_dir/genesis-config.yaml | grep capped_maximum_difficulty | awk '{ print $2 }'` - -python3 ../accounts/mnemonic_to_csv.py $tmp_dir/genesis-config.yaml > ../build/el/accounts.csv - -python3 /apps/el-gen/genesis_geth.py $tmp_dir/genesis-config.yaml | \ - jq ".config.homesteadBlock=$homestead_block" | \ - jq ".config.eip150Block=$eip150_block" | \ - jq ".config.eip155Block=$eip155_block" | \ - jq ".config.eip158Block=$eip158_block" | \ - jq ".config.byzantiumBlock=$byzantium_block" | \ - jq ".config.constantinopleBlock=$constantinople_block" | \ - jq ".config.petersburgBlock=$petersburg_block" | \ - jq ".config.istanbulBlock=$istanbul_block" | \ - jq ".config.berlinBlock=$berlin_block" | \ - jq ".config.londonBlock=$london_block" | \ - jq ".config.mergeForkBlock=$merge_fork_block" > ../build/el/geth.json - -if [ -n "$ttd" ]; then - cat ../build/el/geth.json | jq ".config.terminalTotalDifficulty=$ttd" > ../build/el/geth.json.jq - mv ../build/el/geth.json.jq ../build/el/geth.json -else - cat ../build/el/geth.json | jq "del(.config.terminalTotalDifficulty)" > ../build/el/geth.json.jq - mv ../build/el/geth.json.jq ../build/el/geth.json -fi - -if [ -n "$capped_maximum_difficulty" ]; then - cat ../build/el/geth.json | jq ".config.cappedMaximumDifficulty=$capped_maximum_difficulty" > ../build/el/geth.json.jq - mv ../build/el/geth.json.jq ../build/el/geth.json -else - cat ../build/el/geth.json | jq "del(.config.cappedMaximumDifficulty)" > ../build/el/geth.json.jq - mv ../build/el/geth.json.jq ../build/el/geth.json -fi diff --git a/app/data/container-build/cerc-datanet-eth-geth/build/genesis/el/el-config.yaml b/app/data/container-build/cerc-datanet-eth-geth/build/genesis/el/el-config.yaml deleted file mode 100644 index cb45c936..00000000 --- a/app/data/container-build/cerc-datanet-eth-geth/build/genesis/el/el-config.yaml +++ /dev/null @@ -1,31 +0,0 @@ -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" -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 -el_premine_addrs: {} -chain_id: 1212 -deposit_contract_address: "0x1212121212121212121212121212121212121212" -genesis_timestamp: 0 -capped_maximum_difficulty: 1 -homestead_block: 1 -eip150_block: 1 -eip155_block: 1 -eip158_block: 1 -byzantium_block: 1 -constantinople_block: 1 -petersburg_block: 1 -istanbul_block: 1 -berlin_block: 1 -london_block: 1 -merge_fork_block: 1 - -clique: - enabled: false - signers: - - 36d56343bc308d4ffaac2f793d121aba905fa6cc - - 5e762d4a3847cadaf40a4b0c39574b0ff6698c78 - - 15d7acc1019fdf8ab4f0f7bd31ec1487ecb5a2bd diff --git a/app/data/container-build/cerc-datanet-eth-geth/build/run-el.sh b/app/data/container-build/cerc-datanet-eth-geth/build/run-el.sh deleted file mode 100755 index 3aa0eaf3..00000000 --- a/app/data/container-build/cerc-datanet-eth-geth/build/run-el.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash - -if [ -n "$CERC_SCRIPT_DEBUG" ]; then - set -x -fi - -ETHERBASE=`cat /opt/testnet/build/el/accounts.csv | head -1 | cut -d',' -f2` -NETWORK_ID=`cat /opt/testnet/el/el-config.yaml | grep 'chain_id' | awk '{ print $2 }'` -NETRESTRICT=`ip addr | grep inet | grep -v '127.0' | awk '{print $2}'` - -HOME_DIR=`pwd` -cd /opt/testnet/build/el -python3 -m http.server 9898 & -cd $HOME_DIR - -START_CMD="geth" -if [ "true" == "$CERC_REMOTE_DEBUG" ] && [ -x "/usr/local/bin/dlv" ]; then - START_CMD="/usr/local/bin/dlv --listen=:40000 --headless=true --api-version=2 --accept-multiclient exec /usr/local/bin/geth --continue --" -fi - -if [ "true" == "$RUN_BOOTNODE" ]; then - $START_CMD \ - --nodekeyhex="${BOOTNODE_KEY}" \ - --nodiscover \ - --ipcdisable \ - --networkid=${NETWORK_ID} \ - --netrestrict="${NETRESTRICT}" -else - cd /opt/testnet/accounts - ./import_keys.sh - - echo -n "$JWT" > /opt/testnet/build/el/jwtsecret - - if [ "$CERC_RUN_STATEDIFF" == "detect" ] && [ -n "$CERC_STATEDIFF_DB_HOST" ]; then - dig_result=$(dig $CERC_STATEDIFF_DB_HOST +short) - dig_status_code=$? - if [[ $dig_status_code = 0 && -n $dig_result ]]; then - echo "Statediff DB at $CERC_STATEDIFF_DB_HOST" - CERC_RUN_STATEDIFF="true" - else - echo "No statediff DB available." - CERC_RUN_STATEDIFF="false" - fi - fi - - STATEDIFF_OPTS="" - if [ "$CERC_RUN_STATEDIFF" == "true" ]; then - ready=0 - while [ $ready -eq 0 ]; do - echo "Waiting for statediff DB..." - sleep 1 - export PGPASSWORD="$CERC_STATEDIFF_DB_PASSWORD" - result=$(psql -h "$CERC_STATEDIFF_DB_HOST" \ - -p "$CERC_STATEDIFF_DB_PORT" \ - -U "$CERC_STATEDIFF_DB_USER" \ - -d "$CERC_STATEDIFF_DB_NAME" \ - -t -c 'select max(version_id) from goose_db_version;' 2>/dev/null | awk '{ print $1 }') - if [ -n "$result" ] && [ $result -ge $CERC_STATEDIFF_DB_GOOSE_MIN_VER ]; then - echo "DB ready..." - ready=1 - fi - done - STATEDIFF_OPTS="--statediff=true \ - --statediff.db.host=$CERC_STATEDIFF_DB_HOST \ - --statediff.db.name=$CERC_STATEDIFF_DB_NAME \ - --statediff.db.nodeid=$CERC_STATEDIFF_DB_NODE_ID \ - --statediff.db.password=$CERC_STATEDIFF_DB_PASSWORD \ - --statediff.db.port=$CERC_STATEDIFF_DB_PORT \ - --statediff.db.user=$CERC_STATEDIFF_DB_USER \ - --statediff.db.logstatements=${CERC_STATEDIFF_DB_LOG_STATEMENTS:-false} \ - --statediff.waitforsync=true \ - --statediff.writing=true" - fi - - $START_CMD \ - --bootnodes="${ENODE}" \ - --allow-insecure-unlock \ - --http \ - --http.addr="0.0.0.0" \ - --http.vhosts="*" \ - --http.api="eth,web3,net,admin,personal,debug,statediff" \ - --http.corsdomain="*" \ - --authrpc.addr="0.0.0.0" \ - --authrpc.vhosts="*" \ - --authrpc.jwtsecret="/opt/testnet/build/el/jwtsecret" \ - --networkid="${NETWORK_ID}" \ - --netrestrict="${NETRESTRICT}" \ - --gcmode archive \ - --txlookuplimit=0 \ - --cache.preimages \ - --syncmode=full \ - --mine \ - --miner.threads=1 \ - --metrics \ - --metrics.addr="0.0.0.0" \ - --verbosity=${CERC_GETH_VERBOSITY:-3} \ - --vmodule="${CERC_GETH_VMODULE:-statediff/*=5}" \ - --miner.etherbase="${ETHERBASE}" ${STATEDIFF_OPTS} -fi