-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
144 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
packages/deployment/upgrade-test/upgrade-test-scripts/env.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
#!/bin/bash | ||
|
||
# TODO what else should be in here? | ||
export DEBUG="SwingSet:ls,SwingSet:vat" | ||
|
||
export CHAINID=agoriclocal | ||
shopt -s expand_aliases | ||
|
||
alias agops="yarn run --silent agops" | ||
if test -f "$HOME/.agoric/envs"; then | ||
source "$HOME/.agoric/envs" | ||
fi | ||
|
||
export binary=ag0 | ||
if [ -x "$(command -v "agd")" ]; then | ||
export binary=agd | ||
fi | ||
export GOV1ADDR=$($binary keys show gov1 -a --keyring-backend="test") | ||
export GOV2ADDR=$($binary keys show gov2 -a --keyring-backend="test") | ||
export GOV3ADDR=$($binary keys show gov3 -a --keyring-backend="test") | ||
export VALIDATORADDR=$($binary keys show validator -a --keyring-backend="test") | ||
export USER1ADDR=$($binary keys show user1 -a --keyring-backend="test") | ||
|
||
if [[ "$binary" == "agd" ]]; then | ||
configdir=/usr/src/agoric-sdk/packages/vm-config | ||
test -d "$configdir" || configdir=/usr/src/agoric-sdk/packages/vats | ||
# Support testnet addresses | ||
sed -i "s/agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce/$GOV1ADDR/g" "$configdir"/*.json | ||
sed -i "s/agoric140dmkrz2e42ergjj7gyvejhzmjzurvqeq82ang/$GOV2ADDR/g" "$configdir"/*.json | ||
sed -i "s/agoric1w8wktaur4zf8qmmtn3n7x3r0jhsjkjntcm3u6h/$GOV3ADDR/g" "$configdir"/*.json | ||
|
||
# Support mainnet addresses | ||
sed -i "s/agoric1gx9uu7y6c90rqruhesae2t7c2vlw4uyyxlqxrx/$GOV1ADDR/g" "$configdir"/*.json | ||
sed -i "s/agoric1d4228cvelf8tj65f4h7n2td90sscavln2283h5/$GOV2ADDR/g" "$configdir"/*.json | ||
sed -i "s/agoric1zayxg4e9vd0es9c9jlpt36qtth255txjp6a8yc/$GOV3ADDR/g" "$configdir"/*.json | ||
sed -i '/agoric14543m33dr28x7qhwc558hzlj9szwhzwzpcmw6a/d' "$configdir"/*.json | ||
sed -i '/agoric13p9adwk0na5npfq64g22l6xucvqdmu3xqe70wq/d' "$configdir"/*.json | ||
sed -i '/agoric1el6zqs8ggctj5vwyukyk4fh50wcpdpwgugd5l5/d' "$configdir"/*.json | ||
|
||
# change names to gov1/2/3 since order is significant for invitation sending | ||
sed -i "s/Jason Potts/gov1/g" "$configdir"/*.json | ||
sed -i "s/Chloe White/gov2/g" "$configdir"/*.json | ||
sed -i "s/Joe Clark/gov3/g" "$configdir"/*.json | ||
|
||
# Oracle Addresses | ||
sed -i "s/agoric1krunjcqfrf7la48zrvdfeeqtls5r00ep68mzkr/$GOV1ADDR/g" "$configdir"/*.json | ||
sed -i "s/agoric1n4fcxsnkxe4gj6e24naec99hzmc4pjfdccy5nj/$GOV2ADDR/g" "$configdir"/*.json | ||
sed -i '/agoric19uscwxdac6cf6z7d5e26e0jm0lgwstc47cpll8/d' "$configdir"/*.json | ||
sed -i '/agoric144rrhh4m09mh7aaffhm6xy223ym76gve2x7y78/d' "$configdir"/*.json | ||
sed -i '/agoric19d6gnr9fyp6hev4tlrg87zjrzsd5gzr5qlfq2p/d' "$configdir"/*.json | ||
|
||
# committeeSize | ||
sed -i 's/committeeSize": 6/committeeSize": 3/g' "$configdir"/*.json | ||
sed -i 's/minSubmissionCount": 3/minSubmissionCount": 1/g' "$configdir"/*.json | ||
fi | ||
|
||
startAgd() { | ||
agd start --log_level warn "$@" & | ||
AGD_PID=$! | ||
echo $AGD_PID > $HOME/.agoric/agd.pid | ||
wait_for_bootstrap | ||
waitForBlock 2 | ||
} | ||
|
||
killAgd() { | ||
AGD_PID=$(cat $HOME/.agoric/agd.pid) | ||
kill $AGD_PID | ||
rm $HOME/.agoric/agd.pid | ||
wait $AGD_PID || true | ||
} | ||
|
||
waitAgd() { | ||
wait $(cat $HOME/.agoric/agd.pid) | ||
rm $HOME/.agoric/agd.pid | ||
} | ||
|
||
wait_for_bootstrap() { | ||
endpoint="localhost" | ||
while true; do | ||
if json=$(curl -s --fail -m 15 "$endpoint:26657/status"); then | ||
if [[ "$(echo "$json" | jq -r .jsonrpc)" == "2.0" ]]; then | ||
if last_height=$(echo "$json" | jq -r .result.sync_info.latest_block_height); then | ||
if [[ "$last_height" != "1" ]]; then | ||
echo "$last_height" | ||
return | ||
else | ||
echo "$last_height" | ||
fi | ||
fi | ||
fi | ||
fi | ||
sleep 2 | ||
done | ||
} | ||
|
||
waitForBlock() ( | ||
times=${1:-1} | ||
echo "$times" | ||
for ((i = 1; i <= times; i++)); do | ||
b1=$(wait_for_bootstrap) | ||
while true; do | ||
b2=$(wait_for_bootstrap) | ||
if [[ "$b1" != "$b2" ]]; then | ||
echo "block produced" | ||
break | ||
fi | ||
sleep 1 | ||
done | ||
done | ||
) | ||
|
||
export USDC_DENOM="ibc/toyusdc" | ||
# Recent transfer to Emerynet | ||
export ATOM_DENOM="ibc/06362C6F7F4FB702B94C13CD2E7C03DEC357683FD978936340B43FBFBC5351EB" | ||
export PSM_PAIR="IST.ToyUSD" | ||
if [[ "$BOOTSTRAP_MODE" == "main" ]]; then | ||
export USDC_DENOM="ibc/295548A78785A1007F232DE286149A6FF512F180AF5657780FC89C009E2C348F" | ||
export ATOM_DENOM="ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA" | ||
export PSM_PAIR="IST.USDC_axl" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters