LocalNet Upgrade Testing
CURRENT_HEIGHT=$(./release_binaries/pocket_darwin_arm64 q consensus comet block-latest -o json | jq '.sdk_block.last_commit.height' | tr -d '"')
UPGRADE_HEIGHT=$((CURRENT_HEIGHT + 20))
sed -i.bak "s/\"height\": \"[^\"]*\"/\"height\": \"$UPGRADE_HEIGHT\"/" tools/scripts/upgrades/upgrade_tx_v0.1.2_local.json
cat ./tools/scripts/upgrades/upgrade_tx_v0.1.2_local.json1
2
3
[Advanced] Fast Iteration for Local Changes
This is rough and advanced. We will update and streamline this section in the future — use at your own risk for now.
Setup (one time)
One time setup & preparation to test local changes.
Old repo:
# Checkout the previous release
git checkout v<previous_release_tag>
# Prepare the release
make release_tag_local_testing
# Rebuild the binary
make go_develop ignite_release_local ignite_release_extract_binaries
# Reset to genesis
./release_binaries/pocket_darwin_arm64 comet unsafe-reset-all && make localnet_regenesis
# Start the binary
./release_binaries/pocket_darwin_arm64 startNew repo:
# Checkout the working feature branch
git checkout <working_feature_branch>
# Prepare the release
make release_tag_local_testing
# Update the upgrade
# CRUD `allUpgrades` in `app/upgrades.go`
# See TODO to manually update `pocket-local` in `NetworkAuthzGranteeAddress`
# Rebuild the binary
make go_develop ignite_release_local ignite_release_extract_binaries
# Start the binary
# ./release_binaries/pocket_darwin_arm64 startIterate (repeated)
The steps you'll be repeating many times through the process.
Old repo:
# Reset to genesis
./release_binaries/pocket_darwin_arm64 comet unsafe-reset-all && make localnet_regenesis
# Start the binary
./release_binaries/pocket_darwin_arm64 start
# Update the upgrade height
CURRENT_HEIGHT=$(./release_binaries/pocket_darwin_arm64 q consensus comet block-latest -o json | jq '.sdk_block.last_commit.height' | tr -d '"')
UPGRADE_HEIGHT=$((CURRENT_HEIGHT + 20))
sed -i.bak "s/\"height\": \"[^\"]*\"/\"height\": \"$UPGRADE_HEIGHT\"/" tools/scripts/upgrades/upgrade_tx_v0.1.2_local.json
cat ./tools/scripts/upgrades/upgrade_tx_vX.Y.Z_local.json
# Submit the upgrade
./release_binaries/pocket_darwin_arm64 tx authz exec tools/scripts/upgrades/upgrade_tx_vX.Y.Z_local.json --yes --from=pnf
# Stop the binaryNew repo:
# Compile the binaries on every change/iteration
make go_develop ignite_release_local ignite_release_extract_binaries
# Start the binary after the release in the other one goes through
./release_binaries/pocket_darwin_arm64 start
# Test your changesWas this helpful?
