Skip to content

Commit

Permalink
Merge pull request #2 from vulcanize/v1.10.3-statediff-0.0.22
Browse files Browse the repository at this point in the history
update geth-statediff to version v1.10.3-statediff-0.0.22
  • Loading branch information
ramilexe authored Jun 10, 2021
2 parents dd97723 + dd61c0c commit 6eb2428
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 5 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion docker/startup_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/dapp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
7 changes: 7 additions & 0 deletions src/dapp/libexec/dapp/dapp---testnet-launch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,6 +34,7 @@ RPC_ADDRESS=127.0.0.1
PERIOD=0
CHAINID=99
ACCOUNTS=0
ADDRESS=
gethdir=$HOME/.dapp/testnet

while [[ $1 ]]; do
Expand All @@ -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
Expand All @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion src/dapp/libexec/dapp/dapp---version
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/go-ethereum-statediff/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down

0 comments on commit 6eb2428

Please sign in to comment.