diff --git a/README.md b/README.md index 3e218799d..08ea7cb34 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,26 @@ Then install dapptools: curl https://dapp.tools/install | sh ``` +### Upgrading geth-statediff + +1. Set version at `src/go-ethereum-statediff/default.nix` line 5 +2. Get sha256 hash using + ``` + nix-prefetch-url https://github.com/vulcanize/go-ethereum/releases/download/${version}/geth-linux-amd64 + ``` + Replace `${version}` with correct geth-statediff version. For example: + ``` + > nix-prefetch-url https://github.com/vulcanize/go-ethereum/releases/download/v1.10.3-statediff-0.0.22/geth-linux-amd64 + [39.4 MiB DL] + path is '/nix/store/9da7jqjw52lhl9cr6an8m4c478rg6yn6-geth-linux-amd64' + 1jnc96ly0qi40j8dlgip520n83gfrbv30bqdk9h5fslxzcwhf0yj + ``` + + `1jnc96ly0qi40j8dlgip520n83gfrbv30bqdk9h5fslxzcwhf0yj` is sha256 hash. Set it at `src/go-ethereum-statediff/default.nix` line 8 +3. Bump versions at + * `src/dapp/libexec/dapp/dapp---version` + * `src/dapp/default.nix` line 7 + ### Installing custom solc versions You can specify a custom `solc` version to run within `dapp` with `dapp --use diff --git a/docker/startup_script.sh b/docker/startup_script.sh index 698f730bb..abb7d5c66 100644 --- a/docker/startup_script.sh +++ b/docker/startup_script.sh @@ -7,7 +7,8 @@ trap 'killall geth && rm -rf "$TMPDIR"' EXIT trap "exit 1" SIGINT SIGTERM TMPDIR=$(mktemp -d) -dapp testnet --rpc-addr 0.0.0.0 --chain-id 4 --db-user $DB_USER --db-password $DB_PASSWORD --db-name $DB_NAME --db-host $DB_HOST --db-port $DB_PORT --dir "$TMPDIR" & +dapp testnet --rpc-addr 0.0.0.0 --chain-id 4 --db-user $DB_USER --db-password $DB_PASSWORD --db-name $DB_NAME \ + --db-host $DB_HOST --db-port $DB_PORT --dir "$TMPDIR" --address=$ADDRESS & echo "sleeping 90 sec" # give it a few secs to start up sleep 90 diff --git a/src/dapp/default.nix b/src/dapp/default.nix index 0fe41547b..e1c4b4c2f 100644 --- a/src/dapp/default.nix +++ b/src/dapp/default.nix @@ -4,7 +4,7 @@ stdenv.mkDerivation rec { name = "dapp-${version}"; - version = "0.29.0-v1.10.2-statediff-0.0.19"; + version = "0.29.0-v1.10.3-statediff-0.0.22"; src = ./.; nativeBuildInputs = [makeWrapper shellcheck coreutils nodejs]; diff --git a/src/dapp/libexec/dapp/dapp---testnet-launch b/src/dapp/libexec/dapp/dapp---testnet-launch index 1c1c3264b..963df2fb4 100755 --- a/src/dapp/libexec/dapp/dapp---testnet-launch +++ b/src/dapp/libexec/dapp/dapp---testnet-launch @@ -14,6 +14,7 @@ rpc-addr=address change RPC address (default: 127.0.0.1) chain-id=number change chain ID (default: 99) period=seconds use a block time instead of instamine accounts=number create multiple accounts (default: 1) +address=address eth address to add to genesis save=name after finishing, save snapshot load=name start from a previously saved snapshot dir=directory testnet directory @@ -33,6 +34,7 @@ RPC_ADDRESS=127.0.0.1 PERIOD=0 CHAINID=99 ACCOUNTS=0 +ADDRESS= gethdir=$HOME/.dapp/testnet while [[ $1 ]]; do @@ -49,6 +51,7 @@ while [[ $1 ]]; do --period) shift; PERIOD=$1;; --accounts) shift; ACCOUNTS=$(($1 - 1));; --save) shift; SAVE=$1;; + --address) shift; ADDRESS=$1;; --load) shift; LOAD=$1;; --dir) shift; gethdir=$1;; *) printf "${0##*/}: internal error: %q\\n" "$1"; exit 1 @@ -72,6 +75,10 @@ else done mkdir -p "$chaindir/config" + if [ -n "$ADDRESS" ]; then + balance+=(-n {} -s "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" -i balance \ + -i "$ADDRESS") + fi for i in $(seq 0 "$ACCOUNTS"); do address+=( "$( geth 2>/dev/null account new --datadir "$chaindir" --password=<(exit) 2>/dev/null \ diff --git a/src/dapp/libexec/dapp/dapp---version b/src/dapp/libexec/dapp/dapp---version index a464fdf77..688153b82 100755 --- a/src/dapp/libexec/dapp/dapp---version +++ b/src/dapp/libexec/dapp/dapp---version @@ -1,5 +1,5 @@ #!/usr/bin/env bash -echo dapp 0.29.0-v1.10.2-statediff-0.0.19 +echo dapp 0.29.0-v1.10.3-statediff-0.0.22 # use a custom path is DAPP_SOLC is set SOLC=${DAPP_SOLC:-solc} $SOLC --version diff --git a/src/go-ethereum-statediff/default.nix b/src/go-ethereum-statediff/default.nix index f1168e420..04a9fa085 100644 --- a/src/go-ethereum-statediff/default.nix +++ b/src/go-ethereum-statediff/default.nix @@ -2,10 +2,10 @@ stdenv.mkDerivation rec { name = "go-ethereum-statediff"; - version = "v1.10.2-statediff-0.0.19"; + version = "v1.10.3-statediff-0.0.22"; src = fetchurl { url = "https://github.com/vulcanize/go-ethereum/releases/download/${version}/geth-linux-amd64"; - sha256 = "09fcc7r2qrwp9zzghdrv6xb4v7rzqpak0sbvp7j1zmkk0kwvg26k"; + sha256 = "1jnc96ly0qi40j8dlgip520n83gfrbv30bqdk9h5fslxzcwhf0yj"; }; phases = ["installPhase" "patchPhase"];