Skip to content

Commit

Permalink
use vulcanize geth fork (statediff)
Browse files Browse the repository at this point in the history
show get version on start up
add `statediff` postfix to dapp version
  • Loading branch information
ramilexe committed Sep 3, 2020
1 parent 7b6a231 commit cdd6aed
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 22 deletions.
18 changes: 1 addition & 17 deletions overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,7 @@ in rec {

# We use this to run private testnets without
# the pesky transaction size limit.
go-ethereum-unlimited = super.go-ethereum.overrideAttrs (geth: rec {
name = "${geth.pname}-unlimited-${geth.version}";
preConfigure = ''
# Huge transaction calldata
substituteInPlace core/tx_pool.go --replace 'return ErrOversizedData' ""
# Huge contracts
substituteInPlace params/protocol_params.go --replace \
'MaxCodeSize = 24576' \
'MaxCodeSize = 1000000'
# Huge block gas limit in --dev mode
substituteInPlace core/genesis.go --replace \
'GasLimit: 6283185,' \
'GasLimit: 0xffffffffffffffff,'
'';
});
go-ethereum-unlimited = self.callPackage (import ./src/go-ethereum-statediff) {};

qrtx = self.bashScript {
name = "qrtx";
Expand Down
10 changes: 6 additions & 4 deletions src/dapp/libexec/dapp/dapp---testnet-launch
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ export ETH_RPC_URL=http://$RPC_ADDRESS:$RPC_PORT

port=$((RPC_PORT + 30000))

echo >&2 "dapp-testnet: RPC URL: $ETH_RPC_URL"
geth version
echo >&2 "dapp-testnet: RPC URL: $ETH_RPC_URL"
echo >&2 "dapp-testnet: TCP port: $port"
echo >&2 "dapp-testnet: Chain ID: $CHAINID"
echo >&2 "dapp-testnet: Database: $chaindir"
Expand All @@ -107,8 +108,9 @@ geth \
2> >(tee "$chaindir/geth.log" | grep --line-buffered Success | sed 's/^/geth: /' >&2) \
--datadir "$chaindir" --networkid "$CHAINID" --port="$port" \
--mine --minerthreads=1 --allow-insecure-unlock \
--rpc --rpcapi "web3,eth,net,debug,personal" --rpccorsdomain '*' --nodiscover \
--rpcaddr="$RPC_ADDRESS" --rpcport="$RPC_PORT" --unlock="$(IFS=,; echo "${address[*]}")" --password=<(exit) &
--rpc --rpcapi "web3,eth,net,debug,personal,statediff" --rpccorsdomain '*' --nodiscover \
--rpcaddr="$RPC_ADDRESS" --rpcport="$RPC_PORT" --syncmode=full --statediff --ws --wsaddr="0.0.0.0" \
--unlock="$(IFS=,; echo "${address[*]}")" --password=<(exit) &

gethpid=$!

Expand All @@ -132,7 +134,7 @@ ETH_FROM=$(seth --rpc-url="$ETH_RPC_URL" rpc eth_coinbase)
export ETH_FROM
export ETH_KEYSTORE=$chaindir/keystore
export ETH_PASSWORD=/dev/null
printf 'dapp-testnet: Account: %s (default)\n' "${address[0]}" >&2
printf 'dapp-testnet: Account: %s (default)\n' "${address[0]}" >&2
[[ "${#address[@]}" -gt 1 ]] && printf 'dapp-testnet: Account: %s\n' "${address[@]:1}" >&2

if [[ $1 ]]; then
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.28.0
echo dapp 0.29.0-statediff-0.0.1
# use a custom path is DAPP_SOLC is set
SOLC=${DAPP_SOLC:-solc}
$SOLC --version
Expand Down
17 changes: 17 additions & 0 deletions src/go-ethereum-statediff/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
name = "go-ethereum-statediff";
version = "v1.9.11-statediff-0.0.6";
src = fetchurl {
url = "https://github.com/vulcanize/go-ethereum/releases/download/${version}/geth-linux-amd64";
sha256 = "0rvsvggfmayiw18fnka1d4x9bvrgbp8nymh7bmx9ycayvwhlza54";
};

phases = ["installPhase" "patchPhase"];
installPhase = ''
mkdir -p $out/bin
cp $src $out/bin/geth
chmod +x $out/bin/geth
'';
}

0 comments on commit cdd6aed

Please sign in to comment.