-
Notifications
You must be signed in to change notification settings - Fork 970
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide script to help with settings upgrades
- Loading branch information
Showing
3 changed files
with
63 additions
and
0 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
SECRET_KEY="$1" | ||
PUBLIC_KEY=$(./stellar-core convert-id "$SECRET_KEY" | sed -n '4p' | awk '{print $NF}') | ||
echo "PUBLIC_KEY is $PUBLIC_KEY" | ||
|
||
PUBNET_HORIZON="https://horizon.stellar.org/accounts" | ||
PUBNET_PASSPHRASE="Public Global Stellar Network ; September 2015" | ||
|
||
TESTNET_HORIZON="https://horizon-testnet.stellar.org/accounts" | ||
TESTNET_PASSPHRASE="Test SDF Network ; September 2015" | ||
|
||
HORIZON="" | ||
|
||
#choose which horizon to hit for the SEQ_NUM. If Horizon is down, remove this code and manually set SEQ_NUM below | ||
if [ "$2" == "$PUBNET_PASSPHRASE" ] | ||
then | ||
HORIZON=$PUBNET_HORIZON | ||
elif [ "$2" == "$TESTNET_PASSPHRASE" ] | ||
then | ||
HORIZON=$TESTNET_HORIZON | ||
else | ||
echo "invalid passphrase" | ||
fi | ||
|
||
# get seq num | ||
SEQ_NUM="$(curl -s "$HORIZON/$PUBLIC_KEY" | grep "\"sequence\":" | sed 's/[^0-9]//g')" | ||
re='^[0-9]+$' | ||
if ! [[ $SEQ_NUM =~ $re ]] ; then | ||
echo "Error: SEQ_NUM not retrieved. Your account might not be funded, or Horizon might be down. Hardcode the SEQ_NUM below and remove the horizon code." >&2; exit 1 | ||
fi | ||
|
||
OUTPUT="$(echo $SECRET_KEY | ./stellar-core get-settings-upgrade-txs "$PUBLIC_KEY" "$SEQ_NUM" "$2" --xdr $(stellar-xdr encode --type ConfigUpgradeSet $3) --signtxs)" | ||
|
||
echo "----- TX #1 -----" | ||
echo "curl -G 'http://localhost:11626/tx' --data-urlencode 'blob=$(echo "$OUTPUT" | sed -n '1p')'" | ||
|
||
echo "----- TX #2 -----" | ||
echo "curl -G 'http://localhost:11626/tx' --data-urlencode 'blob=$(echo "$OUTPUT" | sed -n '3p')'" | ||
|
||
echo "----- TX #3 -----" | ||
echo "curl -G 'http://localhost:11626/tx' --data-urlencode 'blob=$(echo "$OUTPUT" | sed -n '5p')'" | ||
echo "-----" | ||
|
||
echo "curl -G 'http://localhost:11626/dumpproposedsettings' --data-urlencode 'blob=$(echo "$OUTPUT" | sed -n '7p')'" | ||
echo "-----" | ||
|
||
echo "distribute the following command with the upgradetime set to an agreed upon point in the future" | ||
echo "curl -G 'http://localhost:11626/upgrades?mode=set&upgradetime=YYYY-MM-DDT01:25:00Z' --data-urlencode 'configupgradesetkey=$(echo "$OUTPUT" | sed -n '7p')'" |
e1a86bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from dmkozh
at sisuresh@e1a86bf
e1a86bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging sisuresh/stellar-core/settings = e1a86bf into auto
e1a86bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sisuresh/stellar-core/settings = e1a86bf merged ok, testing candidate = 4c0c913
e1a86bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: https://github.com/stellar/stellar-core/actions/runs/8239818648/job/22534528137
success: https://github.com/stellar/stellar-core/actions/runs/8239818648/job/22533897012
success: https://github.com/stellar/stellar-core/actions/runs/8239818648/job/22533896785
success: https://github.com/stellar/stellar-core/actions/runs/8239818648/job/22533896536
success: https://github.com/stellar/stellar-core/actions/runs/8239818648/job/22533896224
success: https://github.com/stellar/stellar-core/actions/runs/8239818648/job/22533895988
success: https://github.com/stellar/stellar-core/actions/runs/8239818648/job/22533895773
success: https://github.com/stellar/stellar-core/actions/runs/8239818648/job/22533895533
success: https://github.com/stellar/stellar-core/actions/runs/8239818648/job/22533895285
success: https://github.com/stellar/stellar-core/actions/runs/8239818648/job/22533894943
success: https://github.com/stellar/stellar-core/actions/runs/8239818648/job/22533894695
success: https://github.com/stellar/stellar-core/actions/runs/8239818648/job/22533894449
success: https://github.com/stellar/stellar-core/actions/runs/8239818648/job/22533894211
success: https://github.com/stellar/stellar-core/actions/runs/8239818648/job/22533893855
e1a86bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 4c0c913