Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add scripts #492

Merged
merged 119 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
c2dd545
delete proposal #6
kkast Feb 6, 2024
c5755c4
use develop branch for ci
kkast Feb 6, 2024
cbcc4ff
use another image
kkast Feb 7, 2024
09f5b95
test
kkast Feb 7, 2024
f1b41a5
removing more broken proposals
kkast Feb 7, 2024
6a87f21
Merge pull request #443 from ComposableFi/prop_migration
kkast Feb 13, 2024
a4e33b4
introduce goreleaser
rjonczy Feb 19, 2024
5dc07ca
remove separate gha for building docker images
rjonczy Feb 19, 2024
cb1b6ac
rename registry owner
rjonczy Feb 19, 2024
044ca38
clean comments
rjonczy Feb 19, 2024
32551cf
use version with v
rjonczy Feb 19, 2024
d047159
add additional tags
rjonczy Feb 19, 2024
79902f5
fix org
rjonczy Feb 19, 2024
d330694
update docker image
rjonczy Feb 20, 2024
053c1fa
added jq
rjonczy Feb 20, 2024
e8e81bf
introduce ibc transfer custom module
RustNinja Feb 20, 2024
acdbf54
custom ibc transfer module ready to replace for testing.
RustNinja Feb 21, 2024
808854b
activate custom ibc module for cosmos chain. chain works.
RustNinja Feb 21, 2024
99d0d9b
Merge pull request #444 from rjonczy/develop
rjonczy Feb 21, 2024
8f2563e
added ibc transfer module that is going to store all params for eth fees
RustNinja Feb 21, 2024
abf6832
resolve conflict with a same name for MsgUpdateEpochParams from staking.
RustNinja Feb 21, 2024
af97b65
Merge pull request #448 from ComposableFi/rustninja/ibctransfer-stora…
RustNinja Feb 21, 2024
9ebd6ea
add dependency to transfer keeper from ibc transfer middleware/params
RustNinja Feb 21, 2024
a38a129
added repeated FeeItem into Params + MVP logic in transfer msg server
RustNinja Feb 21, 2024
fd3e1a7
finalized the Transfer method. send fee to fee. build. chain works.
RustNinja Feb 21, 2024
a957000
Merge pull request #445 from ComposableFi/rustninja/ibc-transfer-cust…
RustNinja Feb 21, 2024
69c3f87
only useful params in genesis for ibc transfer module. Works
RustNinja Feb 21, 2024
2ec20dc
golangci-lint run
RustNinja Feb 21, 2024
bf60bbf
Merge branch 'develop' into rustninja/cosmos-eth-fees
RustNinja Feb 22, 2024
cc66da4
slashing fixes
kkast Feb 23, 2024
148a86d
remove unused types in proto
RustNinja Feb 23, 2024
74fb771
add docs and fix all requested changes by reviewers
RustNinja Feb 23, 2024
ed41eee
Merge pull request #452 from ComposableFi/rustninja/cosmos-eth-fee-re…
RustNinja Feb 23, 2024
5020cc1
review fixes
kkast Feb 27, 2024
d0ca9c9
fix tests
kkast Feb 28, 2024
a7f243d
local setup
kkast Feb 28, 2024
2457d87
allow devnet with custom key gov
dzmitry-lahoda Feb 28, 2024
ccd9a01
relay from master
dzmitry-lahoda Nov 13, 2023
aeba6c1
porting fix from v7
dzmitry-lahoda Feb 28, 2024
eea1da3
Merge pull request #456 from ComposableFi/dz/20
dzmitry-lahoda Feb 28, 2024
aa40b30
refactoring.
RustNinja Mar 5, 2024
2c46ed8
Merge pull request #459 from ComposableFi/rustninja/cosmos-eth-fee-re…
RustNinja Mar 5, 2024
0ee86e6
Merge remote-tracking branch 'origin/develop' into rustninja/cosmos-e…
RustNinja Mar 5, 2024
52f2358
add runtime upgrade handler. for ibc fee feature.
RustNinja Mar 5, 2024
85e2bf9
Merge pull request #449 from ComposableFi/rustninja/cosmos-eth-fees
RustNinja Mar 5, 2024
e6aa837
Merge remote-tracking branch 'origin/develop' into slashing_fix
RustNinja Mar 5, 2024
6c75174
upgrade merged. BankKeeper + GovKeeper + IbcTransferMiddlewareKeeper
RustNinja Mar 5, 2024
1ad4293
Merge pull request #451 from ComposableFi/slashing_fix
RustNinja Mar 5, 2024
391729c
Revert "Merge pull request #451 from ComposableFi/slashing_fix"
RustNinja Mar 6, 2024
be3b7ff
revert banksy changes to resolve halted chain.
RustNinja Mar 6, 2024
35247a7
Revert "allow devnet with custom key gov"
RustNinja Mar 7, 2024
fcdbe5d
create a new chain upgrade handler for chain upgrade.
RustNinja Mar 7, 2024
3bcb8c6
Merge pull request #462 from ComposableFi/revert-gov
RustNinja Mar 11, 2024
db4a106
chore: change centaurid -> picad and prefix name to pica
hoank101 Feb 21, 2024
8602759
chore: update name prefix
hoank101 Feb 21, 2024
6078e1d
refactor: remove old upgrade
hoank101 Feb 21, 2024
0f39635
refactor: update prefix
hoank101 Feb 21, 2024
738971e
refactor: update prefix
hoank101 Feb 21, 2024
240e11c
test: change govAuthorityAddress
hoank101 Feb 21, 2024
93d4312
ci: rollback
hoank101 Feb 21, 2024
f0bc749
wip
tungleanh0902 Feb 21, 2024
db81b87
feat: add script upgrade_test
hoank101 Feb 23, 2024
19b89ef
chore: update script
hoank101 Feb 23, 2024
51b924e
wip
tungleanh0902 Feb 21, 2024
63f41c0
refactor: remove set prefix
hoank101 Feb 23, 2024
e229a6a
refactor: update test
hoank101 Feb 23, 2024
c8a0b98
chore: rollback
hoank101 Feb 23, 2024
fc8f61b
chore: ignore build folder
kienn6034 Feb 23, 2024
12276e2
perf: make blocktime run faster
kienn6034 Feb 23, 2024
3e18f7a
fix: use key with balances
kienn6034 Feb 23, 2024
9e85255
chore: ignore screen log
kienn6034 Feb 23, 2024
75ec77d
refactor: using default flag for test
kienn6034 Feb 23, 2024
30bc27e
test: increment and assert counter value to be equal 1
kienn6034 Feb 23, 2024
58bf6b5
chore: rollback
hoank101 Feb 23, 2024
3445224
chore: rollback script
hoank101 Feb 23, 2024
7417bff
test: add script upgrade
kienn6034 Feb 23, 2024
809843b
fix: correct upgrade height
kienn6034 Feb 23, 2024
c607fc3
feat: add post scripts
kienn6034 Feb 23, 2024
20d9d7b
test: assertion for post scripts
kienn6034 Feb 23, 2024
4604750
chore: stream unnecessary output to null
kienn6034 Feb 23, 2024
753d6ac
feat: add test for the new address
kienn6034 Feb 23, 2024
b639bf9
wip
tungleanh0902 Feb 21, 2024
161855a
chore: log for test upgrade
kienn6034 Feb 27, 2024
d3e1bef
test: completed ibc transfer
tungleanh0902 Feb 28, 2024
0afdacf
verify affection of alliance module
tungleanh0902 Feb 29, 2024
eeb658d
test/ica_migration
tungleanh0902 Mar 1, 2024
4ef65c4
add migration test for mint, ratelimit, ibc-hooks, transfermiddleware…
tungleanh0902 Mar 1, 2024
af82e05
finalize script upgrade test
tungleanh0902 Mar 5, 2024
02effcb
pick denom for testing as stake
tungleanh0902 Mar 6, 2024
0626a6d
remove unused fnc
tungleanh0902 Mar 7, 2024
88a1337
modify testup
tungleanh0902 Mar 7, 2024
fd83a51
fix unused fnc
tungleanh0902 Mar 7, 2024
80e4eef
merge variable
tungleanh0902 Mar 7, 2024
3ee3522
chore: remove release.yml
hoank101 Mar 7, 2024
a83afc8
refactor: change v6.4.6 -> v6.4.7
hoank101 Mar 7, 2024
749020b
feaT: migrate contract info
kienn6034 Mar 7, 2024
80ceff2
test: assert contract info && code info
kienn6034 Mar 7, 2024
8647fd2
fix: change repo secret name
tungleanh0902 Mar 11, 2024
91d9bf5
refactor: change v6.4.7 -> v6.4.8
tungleanh0902 Mar 18, 2024
951fa1b
revert change version
tungleanh0902 Mar 18, 2024
85da880
rebase and change conflict version
tungleanh0902 Mar 18, 2024
aba46bb
Merge branch 'develop2' of https://github.com/ComposableFi/composable…
hoank101 Apr 8, 2024
9c82743
merge from develop2
hoank101 Apr 8, 2024
a11eb18
feat: add v6_6_0 handler
hoank101 Apr 8, 2024
23e9179
remove old upgrade
hoank101 Apr 8, 2024
8bc20a4
fix lint
hoank101 Apr 8, 2024
074ca18
fix lint
hoank101 Apr 8, 2024
9bd630e
fix test
hoank101 Apr 8, 2024
897dbec
update script
hoank101 Apr 8, 2024
da35d9f
update address and ibc-go
hoank101 Apr 11, 2024
b9360a6
fix lint
hoank101 Apr 11, 2024
6189528
Merge branch 'develop2' of https://github.com/ComposableFi/composable…
hoank101 Apr 12, 2024
c49a6ef
fix lint
hoank101 Apr 12, 2024
894d41e
feat: init deps
kienn6034 Apr 12, 2024
2da489b
Kien/e2e test migrate (#23)
kienn6034 Apr 15, 2024
a7a23c9
fix: migration transfermiddleware
hoank101 Apr 15, 2024
90a521b
allow pica12smx2wdlyttvyzvzg54y2vnqwq2qjate0ww798 in local
hoank101 Apr 15, 2024
42d3b84
Merge branch 'develop2' of https://github.com/ComposableFi/composable…
hoank101 Apr 15, 2024
882b8d1
fix lint
hoank101 Apr 15, 2024
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
8 changes: 7 additions & 1 deletion bech32-migration/transfermiddleware/transfermiddleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@ func MigrateAddressBech32(ctx sdk.Context, storeKey storetypes.StoreKey, cdc cod
allowRelayAddressCount := uint64(0)

store := ctx.KVStore(storeKey)

relayAddressPrefix := []byte{1}
iterator := sdk.KVStorePrefixIterator(store, types.KeyRlyAddress)

for ; iterator.Valid(); iterator.Next() {
allowRelayAddressCount++
trimedAddr := strings.Replace(string(iterator.Key()), "\x04", "", 1)
newPrefixAddr := utils.ConvertAccAddr(trimedAddr)
store.Set(types.GetKeyByRlyAddress(newPrefixAddr), []byte{1})
store.Set(types.GetKeyByRlyAddress(newPrefixAddr), relayAddressPrefix)
}
if allowRelayAddressCount == 0 {
// TODO: only using in localtest
store.Set(types.GetKeyByRlyAddress("pica12smx2wdlyttvyzvzg54y2vnqwq2qjate0ww798"), relayAddressPrefix)
}

ctx.Logger().Info(
Expand Down
1 change: 1 addition & 0 deletions scripts/08-wasm/ics10_grandpa_cw.wasm.json

Large diffs are not rendered by default.

103 changes: 40 additions & 63 deletions scripts/localnode.sh
Original file line number Diff line number Diff line change
@@ -1,93 +1,70 @@
#!/bin/bash

echo "starting localnode"

KEY="mykey"
KEY1="mykey1"
CHAINID="centauri-dev"
MONIKER="localtestnet"
KEYALGO="secp256k1"
KEYRING="test"
LOGLEVEL="info"
BINARY=$1
CONTINUE=${CONTINUE:-"false"}
# to trace evm
#TRACE="--trace"
TRACE=""

HOME_DIR=mytestnet
ENV=${ENV:-""}
DENOM=ppica


if [ "$CONTINUE" == "true" ]; then
echo "\n ->> continuing from previous state"
$BINARY start --home $HOME_DIR --log_level debug
exit 0
fi

rm -rf mytestnet
pkill centaurid

# check DENOM is set. If not, set to upica
DENOM=${2:-upica}
echo "denom: $DENOM"
COMMISSION_RATE=0.01
COMMISSION_MAX_RATE=0.02

SED_BINARY=sed
# check if this is OS X
if [[ "$OSTYPE" == "darwin"* ]]; then
# check if gsed is installed
if ! command -v gsed &> /dev/null
then
echo "gsed could not be found. Please install it with 'brew install gnu-sed'"
exit
else
SED_BINARY=gsed
fi
fi
$BINARY config keyring-backend $KEYRING
$BINARY config chain-id $CHAINID

# check BINARY is set. If not, build picad and set BINARY
if [ -z "$BINARY" ]; then
make build
BINARY=build/picad
fi
# remove existing daemon
rm -rf $HOME_DIR

CHAIN_ID="localpica"
KEYRING="test"
KEY="test0"
KEY1="test1"
KEY2="test2"
# if $KEY exists it should be deleted
echo "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry" | $BINARY keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO --recover --home $HOME_DIR
echo "bottom loan skill merry east cradle onion journey palm apology verb edit desert impose absurd oil bubble sweet glove shallow size build burst effort" | $BINARY keys add $KEY1 --keyring-backend $KEYRING --algo $KEYALGO --recover --home $HOME_DIR
$BINARY init $CHAINID --chain-id $CHAINID --default-denom "ppica" --home $HOME_DIR

# Function updates the config based on a jq argument as a string
update_test_genesis () {
# update_test_genesis '.consensus_params["block"]["max_gas"]="100000000"'
cat $HOME_DIR/config/genesis.json | jq "$1" > $HOME_DIR/config/tmp_genesis.json && mv $HOME_DIR/config/tmp_genesis.json $HOME_DIR/config/genesis.json
cat $HOME_DIR/config/genesis.json | jq "$1" > $HOME_DIR/config/tmp_genesis.json && cp $HOME_DIR/config/tmp_genesis.json $HOME_DIR/config/genesis.json
}

$BINARY init --chain-id $CHAIN_ID moniker --home $HOME_DIR

$BINARY keys add $KEY --keyring-backend $KEYRING --home $HOME_DIR
$BINARY keys add $KEY1 --keyring-backend $KEYRING --home $HOME_DIR
$BINARY keys add $KEY2 --keyring-backend $KEYRING --home $HOME_DIR

# Allocate genesis accounts (cosmos formatted addresses)
$BINARY add-genesis-account $KEY "1000000000000000000000${DENOM}" --keyring-backend $KEYRING --home $HOME_DIR
$BINARY add-genesis-account $KEY1 "1000000000000000000000${DENOM}" --keyring-backend $KEYRING --home $HOME_DIR
$BINARY add-genesis-account $KEY2 "1000000000000000000000${DENOM}" --keyring-backend $KEYRING --home $HOME_DIR
$BINARY add-genesis-account $KEY 100000000000000000000000000ppica --keyring-backend $KEYRING --home $HOME_DIR
$BINARY add-genesis-account $KEY1 100000000000000000000000000ppica --keyring-backend $KEYRING --home $HOME_DIR

# Sign genesis transaction
$BINARY gentx $KEY 10030009994127689ppica --keyring-backend $KEYRING --chain-id $CHAINID --home $HOME_DIR

update_test_genesis '.app_state["gov"]["params"]["voting_period"]="5s"'
update_test_genesis '.app_state["mint"]["params"]["mint_denom"]="'$DENOM'"'
update_test_genesis '.app_state["gov"]["params"]["min_deposit"]=[{"denom":"'$DENOM'","amount": "1000000"}]'
update_test_genesis '.app_state["gov"]["params"]["min_deposit"]=[{"denom":"'$DENOM'","amount": "1"}]'
update_test_genesis '.app_state["crisis"]["constant_fee"]={"denom":"'$DENOM'","amount":"1000"}'
update_test_genesis '.app_state["staking"]["params"]["bond_denom"]="'$DENOM'"'

# enable rest server and swagger
$SED_BINARY -i '0,/enable = false/s//enable = true/' $HOME_DIR/config/app.toml
$SED_BINARY -i 's/swagger = false/swagger = true/' $HOME_DIR/config/app.toml
$SED_BINARY -i -e 's/enabled-unsafe-cors = false/enabled-unsafe-cors = true/g' $HOME_DIR/config/app.toml
$SED_BINARY -i 's/minimum-gas-prices = "0.25upica"/minimum-gas-prices = "0.0upica"/' $HOME_DIR/config/app.toml

## Adjust block time
$SED_BINARY -i 's/timeout_commit = "5s"/timeout_commit = "500ms"/' $HOME_DIR/config/config.toml



# Sign genesis transaction
$BINARY gentx $KEY "1000000000000000000000${DENOM}" --commission-rate=$COMMISSION_RATE --commission-max-rate=$COMMISSION_MAX_RATE --keyring-backend $KEYRING --chain-id $CHAIN_ID --home $HOME_DIR

# Collect genesis tx
$BINARY collect-gentxs --home $HOME_DIR

# Run this to ensure everything worked and that the genesis file is setup correctly
$BINARY validate-genesis --home $HOME_DIR
$BINARY start --home $HOME_DIR

if [[ $1 == "pending" ]]; then
echo "pending mode is on, please wait for the first block committed."
fi

# update request max size so that we can upload the light client
# '' -e is a must have params on mac, if use linux please delete before run
sed -i'' -e 's/max_body_bytes = /max_body_bytes = 1/g' $HOME_DIR/config/config.toml
sed -i'' -e 's/max_tx_bytes = 1048576/max_tx_bytes = 10000000/g' $HOME_DIR/config/config.toml
sed -i'' -e 's/timeout_commit = "5s"/timeout_commit = "1s"/' $HOME_DIR/config/config.toml


$BINARY start --rpc.unsafe --rpc.laddr tcp://0.0.0.0:26657 --pruning=nothing --minimum-gas-prices=0.001ppica --home=$HOME_DIR --log_level trace --trace --with-tendermint=true --transport=socket --grpc.enable=true --grpc-web.enable=false --api.enable=true --p2p.pex=false --p2p.upnp=false
47 changes: 47 additions & 0 deletions scripts/upgrade/init_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash


OLD_VERSION=kien-devnet-651
SOFTWARE_UPGRADE_NAME="v6_6_0"
ROOT=$(pwd)

COMPOSABLE_VERSION="branchfortestingpfmfix"

mkdir -p _build/


# Check if the directory exists and is a Git repository
# TODO: using git, since nix in composable repo requires something with git
# Consider using submodule, or firgure this out
if [ ! -d "_build/composable/.git" ]; then
cd _build/
git clone https://github.com/ComposableFi/composable.git composable
cd composable
git checkout "$COMPOSABLE_VERSION"
cd ../.././
fi


# install old binary if not exist
if [ ! -f "_build/$OLD_VERSION.zip" ] &> /dev/null
then
mkdir -p _build/old
wget -c "https://github.com/notional-labs/composable-cosmos/archive/refs/tags/${OLD_VERSION}.zip" -O _build/${OLD_VERSION}.zip
unzip _build/${OLD_VERSION}.zip -d _build
fi

# reinstall old binary
if [ $# -eq 1 ] && [ $1 == "--reinstall-old" ] || ! command -v _build/old/centaurid &> /dev/null; then
cd ./_build/composable-cosmos-${OLD_VERSION}
GOBIN="$ROOT/_build/old" go install -mod=readonly ./...
cd ../..
fi


# install new binary
if ! command -v _build/new/picad &> /dev/null
then
mkdir -p _build/new
GOBIN="$ROOT/_build/new" go install -mod=readonly ./...
fi

13 changes: 13 additions & 0 deletions scripts/upgrade/old-node-scripts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ADDITIONAL_SCRIPTS=(
"./scripts/upgrade/v_6_4_8/setup-08-wasm.sh"
)

for SCRIPT in "${ADDITIONAL_SCRIPTS[@]}"; do
if [ -f "$SCRIPT" ]; then
echo "Running additional script: $SCRIPT"
source $SCRIPT
else
echo "Additional script $SCRIPT does not exist."
fi
done

25 changes: 25 additions & 0 deletions scripts/upgrade/setup-old-centaurid-node.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# the upgrade is a fork, "true" otherwise
FORK=${FORK:-"false"}


BINARY=_build/old/centaurid
HOME=mytestnet
ROOT=$(pwd)
DENOM=ppica
CHAIN_ID=centaurid

ADDITIONAL_PRE_SCRIPTS="./scripts/upgrade/old-node-scripts.sh"

SLEEP_TIME=1


screen -L -dmS node1 bash scripts/localnode.sh $BINARY $DENOM --Logfile $HOME/log-screen.txt
#scripts/localnode.sh $BINARY

sleep 4 # wait for note to start

# execute additional pre scripts
source $ADDITIONAL_PRE_SCRIPTS

6 changes: 6 additions & 0 deletions scripts/upgrade/setup-polkadot-node.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ROOT=$(pwd)

cd $ROOT/_build/composable

# This start the node
nix run .#zombienet-rococo-local-picasso-dev
20 changes: 20 additions & 0 deletions scripts/upgrade/setup-relayer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

ROOT=$(pwd)

cd $ROOT/_build/composable/

# init clients
nix run .#picasso-centauri-ibc-init
sleep 1

# init connection
nix run .#picasso-centauri-ibc-connection-init
sleep 1

# init channel
nix run .#picasso-centauri-ibc-channels-init
sleep 1

# run relayer
nix run .#picasso-centauri-ibc-relay
sleep 1
80 changes: 80 additions & 0 deletions scripts/upgrade/upgrade.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# the upgrade is a fork, "true" otherwise
FORK=${FORK:-"false"}

UPGRADE_WAIT=${UPGRADE_WAIT:-20}
HOME=mytestnet
ROOT=$(pwd)
DENOM=ppica
CHAIN_ID=centauri-dev
SOFTWARE_UPGRADE_NAME="v6_6_0"
ADDITIONAL_PRE_SCRIPTS="./scripts/upgrade/v_6_4_8/pre-script.sh"
ADDITIONAL_AFTER_SCRIPTS="./scripts/upgrade/v_6_4_8/post-script.sh"
KEY="mykey"
KEY1="mykey1"

SLEEP_TIME=1


UPGRADE_PROPOSAL_ID=2
run_upgrade () {
echo -e "\n\n=> =>start upgrading"

# Get upgrade height, 12 block after (6s)
STATUS_INFO=($(./_build/old/centaurid status --home $HOME | jq -r '.NodeInfo.network,.SyncInfo.latest_block_height'))
UPGRADE_HEIGHT=$((STATUS_INFO[1] + 12))
echo "UPGRADE_HEIGHT = $UPGRADE_HEIGHT"

tar -cf ./_build/new/picad.tar -C ./_build/new picad
SUM=$(shasum -a 256 ./_build/new/picad.tar | cut -d ' ' -f1)
UPGRADE_INFO=$(jq -n '
{
"binaries": {
"linux/amd64": "file://'$(pwd)'/_build/new/picad.tar?checksum=sha256:'"$SUM"'",
}
}')


./_build/old/centaurid tx gov submit-legacy-proposal software-upgrade "$SOFTWARE_UPGRADE_NAME" --upgrade-height $UPGRADE_HEIGHT --upgrade-info "$UPGRADE_INFO" --title "upgrade" --description "upgrade" --from $KEY --fees 100000${DENOM} --keyring-backend test --chain-id $CHAIN_ID --home $HOME -y > /dev/null

sleep $SLEEP_TIME

./_build/old/centaurid tx gov deposit $UPGRADE_PROPOSAL_ID "20000000${DENOM}" --from $KEY --keyring-backend test --fees 100000${DENOM} --chain-id $CHAIN_ID --home $HOME -y

sleep $SLEEP_TIME

./_build/old/centaurid tx gov vote $UPGRADE_PROPOSAL_ID yes --from $KEY --keyring-backend test --fees 100000${DENOM} --chain-id $CHAIN_ID --home $HOME -y

sleep $SLEEP_TIME


# determine block_height to halt
while true; do
BLOCK_HEIGHT=$(./_build/old/centaurid status | jq '.SyncInfo.latest_block_height' -r)
if [ $BLOCK_HEIGHT = "$UPGRADE_HEIGHT" ]; then
# assuming running only 1 centaurid
echo "BLOCK HEIGHT = $UPGRADE_HEIGHT REACHED, KILLING OLD ONE"
pkill centaurid
break
else
./_build/old/centaurid q gov proposal $UPGRADE_PROPOSAL_ID --output=json | jq ".status"
echo "BLOCK_HEIGHT = $BLOCK_HEIGHT"
sleep 1
fi
done
}

# if FORK = true
if [[ "$FORK" == "true" ]]; then
run_fork
unset PICA_HALT_HEIGHT
else
run_upgrade
fi

sleep 1

# run new node
echo -e "\n\n=> =>continue running nodes after upgrade"
#CONTINUE="true" screen -L -dmS picad bash scripts/localnode.sh _build/new/picad $DENOM
CONTINUE="true" bash scripts/localnode.sh _build/new/picad $DENOM

23 changes: 23 additions & 0 deletions scripts/upgrade/v_6_4_8/setup-08-wasm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
KEY=mykey
KEYALGO="secp256k1"
KEYRING="test"
HOME_DIR="mytestnet"
BINARY=_build/old/centaurid
DENOM=ppica
CHAINID=centauri-dev

$BINARY tx gov submit-proposal scripts/08-wasm/ics10_grandpa_cw.wasm.json --from=$KEY --fees 100000${DENOM} --gas auto --keyring-backend test --home $HOME_DIR --chain-id $CHAINID -y

sleep 2
# TODO: fetch the propsoal id dynamically
$BINARY tx gov deposit "1" "20000000ppica" --from $KEY --fees 100000${DENOM} --keyring-backend test --home $HOME_DIR --chain-id $CHAINID -y

sleep 2
$BINARY tx gov vote 1 yes --from $KEY --fees 100000${DENOM} --keyring-backend test --home $HOME_DIR --chain-id $CHAINID -y


## Voting time is 5s, check in localnode.sh
sleep 5

$BINARY query 08-wasm all-wasm-code --home $HOME_DIR --chain-id $CHAINID
Loading