Skip to content
This repository was archived by the owner on May 28, 2025. 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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ gateway/config/config.toml
prometheus/data
grafana/data
.DS_Store
tmp
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
entrypoint: ["sh", "/home/pocket/start-poktrolld.sh"]
environment:
- NODE_HOSTNAME=${NODE_HOSTNAME}
- NETWORK_NAME=${NETWORK_NAME}
- POKTROLLD_LOG_LEVEL=${POKTROLLD_LOG_LEVEL}
- DAEMON_NAME=poktrolld
- DAEMON_HOME=/home/pocket/.poktroll
Expand Down
18 changes: 18 additions & 0 deletions scripts/init-poktrolld.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,24 @@ if [ -n "$NETWORK_NAME" ]; then
exit 1
fi
fi

# Add testnet-alpha specific mitigation after the binary setup
if [ "$NETWORK_NAME" = "testnet-alpha" ]; then
# Check for upgrade info file
UPGRADE_INFO_FILE="/home/pocket/.poktroll/data/upgrade-info.json"
if [ -f "$UPGRADE_INFO_FILE" ]; then
UPGRADE_HEIGHT=$(jq -r '.height' "$UPGRADE_INFO_FILE")
if [ "$UPGRADE_HEIGHT" = "83725" ]; then
echo "Applying testnet-alpha mitigation..."
# Remove upgrade info file
rm "$UPGRADE_INFO_FILE"
# Change symlink back to v0.0.10
rm -f /home/pocket/.poktroll/cosmovisor/current
ln -s /home/pocket/.poktroll/cosmovisor/upgrades/v0.0.10 /home/pocket/.poktroll/cosmovisor/current
echo "Successfully applied testnet-alpha mitigation"
fi
fi
fi
else
echo "NETWORK_NAME variable not set. Please set it to 'testnet-alpha', 'testnet-beta', or 'mainnet'."
exit 1
Expand Down
11 changes: 10 additions & 1 deletion scripts/start-poktrolld.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,17 @@ set -e
# Read the seeds from the genesis.seeds file
export SEEDS=$(cat "$DAEMON_HOME/config/genesis.seeds")

# Add skip-upgrades flag for testnet-alpha
EXTRA_FLAGS=""
if [ "$NETWORK_NAME" = "testnet-alpha" ]; then
# TODO(@okdas): move this into the separate file in `genesis` repo like we do this for seeds. That way, we can
# automate this in the future for all networks.
EXTRA_FLAGS="--unsafe-skip-upgrades=83725"
fi

# Start the binary via Cosmovisor
exec cosmovisor run start \
--p2p.external-address="${NODE_HOSTNAME}:26656" \
--log_level="${POKTROLLD_LOG_LEVEL}" \
--p2p.seeds="${SEEDS}"
--p2p.seeds="${SEEDS}" \
${EXTRA_FLAGS}