Skip to content

Commit

Permalink
fix runbundler
Browse files Browse the repository at this point in the history
faster startup (deployment)
geth logging
simpler wait-for-bundler
funder: supports private key without "0x" prefix
  • Loading branch information
drortirosh committed Oct 4, 2023
1 parent c72faee commit 42a494b
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 54 deletions.
5 changes: 3 additions & 2 deletions runall.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash -e
root=`cd \`dirname $0\`; pwd`
root=`realpath \`dirname $0\``

BUILD=$root/build
OUT=$BUILD/out
Expand All @@ -26,8 +26,9 @@ mkdir -p $OUT

for bundler in $BUNDLERS; do

bundlerTitle=`echo $bundler|perl -pe "s@$root/?@@"`
echo ====================================================================
echo ====== $bundler
echo ====== $bundlerTitle
echo ====================================================================

basename=`basename -s .yml $bundler`
Expand Down
3 changes: 2 additions & 1 deletion runbundler/deployer/create2deployer.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh -e
test -n "$VERBOSE" && set -x

test -z "$1" && cat <<EOF && exit 1
usage: $0 {constructor} [salt]
Expand Down Expand Up @@ -31,7 +32,7 @@ fi
if [ `cast cs $deployerAddress` == 0 ]; then

cast send $CAST_FROM $factoryDeployer --value $deploymentPrice > /dev/null
cast publish $deployerDeploymentTransaction > /dev/null
cast publish --async $deployerDeploymentTransaction > /dev/null
fi

salt=${2:-0}
Expand Down
6 changes: 3 additions & 3 deletions runbundler/funder/funder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ funderBal=`cast balance $funder`
test "$funderBal" = "0" && fatal "Funder account $funder has no balance"

for addr in $FUND; do
len=`echo $addr | wc -c`
len=`echo -n $addr | wc -c | xargs`
case $len in
*43) echo . ;;
*67) addr=`cast wallet address $addr` ;;
42) ;;
64|66) addr=`cast wallet address $addr` ;;
*) fatal "not an address and not privatekey: $addr" ;;
esac

Expand Down
2 changes: 1 addition & 1 deletion runbundler/geth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
container_name: geth-1.10
ports: [ '8545:8545' ]
image: ethereum/client-go:release-1.10
command: --verbosity 3
command: --verbosity 2
--http.vhosts '*,localhost,host.docker.internal'
--http
--http.api personal,eth,net,web3,debug
Expand Down
37 changes: 22 additions & 15 deletions runbundler/runbundler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,32 @@ services:
deployer:
condition: service_completed_successfully

wait-for-bundler:
build: ./wait-for-bundler
command: $BUNDLER_URL
environment:
- VERBOSE=$VERBOSE
bundler-waiter:
image: ghcr.io/foundry-rs/foundry:latest
command:
- sleep 1; cast chain-id -r $BUNDLER_URL
depends_on:
bundler:
condition: service_started
restart: on-failure

#todo: incomplete..
runtest:
build: ./runtest
# command: $RUNTEST
environment:
- TEST=pdm run pytest --tb=short -rA -W ignore::DeprecationWarning --url $BUNDLER_URL --entry-point $ENTRYPOINT --ethereum-node $ETH_RPC_URL
- ETH_RPC_URL=$ETH_RPC_URL
- ENTRYPOINT=$ENTRYPOINT
- BUNDLER_URL=$BUNDLER_URL
wait-for-bundler:
image: ghcr.io/foundry-rs/foundry:latest
command: echo started
depends_on:
wait-for-bundler:
bundler-waiter:
condition: service_completed_successfully

#todo: incomplete..
# runtest:
# build: ./runtest
# # command: $RUNTEST
# environment:
# - TEST=pdm run pytest --tb=short -rA -W ignore::DeprecationWarning --url $BUNDLER_URL --entry-point $ENTRYPOINT --ethereum-node $ETH_RPC_URL
# - ETH_RPC_URL=$ETH_RPC_URL
# - ENTRYPOINT=$ENTRYPOINT
# - BUNDLER_URL=$BUNDLER_URL
# depends_on:
# wait-for-bundler:
# condition: service_completed_successfully

6 changes: 0 additions & 6 deletions runbundler/wait-for-bundler/Dockerfile

This file was deleted.

26 changes: 0 additions & 26 deletions runbundler/wait-for-bundler/waitForBundler

This file was deleted.

0 comments on commit 42a494b

Please sign in to comment.