-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathupgrade.sh
More file actions
26 lines (20 loc) · 1.21 KB
/
upgrade.sh
File metadata and controls
26 lines (20 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# This script will print a command to be used on a validator to create
# the JSON file with the upgrade proposal details, which can be submitted
# to the network to trigger the upgrade process.
# Update the variables below to match current conditions and desired upgrade
current_version=v0.15.1
new_version=v0.16.0
expedited=true
deposit=50000000uallo
num_minutes_between_proposal_and_upgrade=780
avg_block_time=5 # seconds
current_height=10000
# Calculating height
height=$((60*num_minutes_between_proposal_and_upgrade/avg_block_time+current_height))
# To get the authority address, run this command on the validator:
# allorad q upgrade authority | grep address | awk '{print $2}'
#
authority=allo10d07y265gmmuvt4z0w9aw880jnsr700j53fxp2 # replace with the actual address
json='{"messages":[{"@type":"/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade","authority":"'$authority'","plan":{"name":"'$new_version'","time":"0001-01-01T00:00:00Z","height":"'$height'","info":"","upgraded_client_state":null}}],"metadata":"ipfs://CID","deposit":"'$deposit'","title":"'$new_version'","summary":"Upgrade from '$current_version' to '$new_version'","expedited":'$expedited'}'
echo "json='$json' && echo \"\$json\" | jq . > upgrade.json"