Skip to content
This repository was archived by the owner on Jun 13, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

9 changes: 6 additions & 3 deletions libexec/dapp/dapp---testnet-launch
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ period=seconds use a block time instead of instamine
accounts=number create multiple accounts (default: 1)
save=name after finishing, save snapshot
load=name start from a previously saved snapshot
rpc-host=host change RPC host (default: \`localhost')
"

eval "$(
Expand All @@ -25,6 +26,7 @@ while [[ $1 ]]; do
case $1 in
--) shift; break;;
--rpc-port) shift; RPC_PORT=$1;;
--rpc-host) shift; RPC_HOST=$1;;
--chain-id) shift; CHAINID=$1;;
--period) shift; PERIOD=$1;;
--accounts) shift; ACCOUNTS=$(($1 - 1));;
Expand Down Expand Up @@ -77,7 +79,7 @@ else
geth 2>/dev/null --datadir "$chaindir" init "$chaindir/config/genesis.json"
fi

export ETH_RPC_URL=http://127.0.0.1:$RPC_PORT
export ETH_RPC_URL=http://${RPC_HOST-localhost}:$RPC_PORT

port=$((RPC_PORT + 30000))

Expand All @@ -95,8 +97,9 @@ set +m
geth \
2> >(tee "$chaindir/geth.log" | grep --line-buffered Success | sed 's/^/geth: /' >&2) \
--datadir "$chaindir" --networkid "$CHAINID" --port="$port" \
--rpcaddr "${RPC_HOST-localhost}" \
--mine --minerthreads=1 \
--rpc --rpcapi "web3,eth,net,debug" --rpccorsdomain '*' --nodiscover \
--rpc --rpcapi "web3,eth,net,debug" --rpccorsdomain '*' \
--rpcport="$RPC_PORT" --unlock="$(IFS=,; echo "${address[*]}")" --password=<(exit) &

gethpid=$!
Expand Down Expand Up @@ -128,4 +131,4 @@ if [[ $1 ]]; then
"$@"
else
while true; do sleep 3600; done
fi
fi