Skip to content

Commit

Permalink
fix: scripts to deploy pica node
Browse files Browse the repository at this point in the history
  • Loading branch information
duvbell committed Apr 24, 2024
1 parent bb9d8e6 commit 16c0213
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 211 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ test-upgrade: clean-testing-data

clean-testing-data:
@echo "Killing binary and removing previous data"
-@pkill centaurid 2>/dev/null
-@pkill picad 2>/dev/null
-@pkill rly 2>/dev/null
-@rm -rf ./mytestnet
Expand All @@ -192,9 +191,9 @@ init-deps:
@echo "Installing dependencies"
bash ./scripts/upgrade/init-deps.sh

localnet-centauri:
localnet-pica:
@echo "Starting localnet"
bash ./scripts/upgrade/setup-old-centaurid-node.sh
bash ./scripts/upgrade/setup-old-picad-node.sh

localnet-picasso:
@echo "Starting localnet"
Expand Down
69 changes: 69 additions & 0 deletions scripts/upgrade/localnode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

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

HOME_DIR=mytestnet
DENOM=ppica


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

$BINARY config keyring-backend $KEYRING
$BINARY config chain-id $CHAINID

# remove existing daemon
rm -rf $HOME_DIR

# 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

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 && cp $HOME_DIR/config/tmp_genesis.json $HOME_DIR/config/genesis.json
}

# Allocate genesis accounts (cosmos formatted addresses)
$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": "1"}]'
update_test_genesis '.app_state["crisis"]["constant_fee"]={"denom":"'$DENOM'","amount":"1000"}'

# 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

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


$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
2 changes: 1 addition & 1 deletion scripts/upgrade/old-node-scripts.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ADDITIONAL_SCRIPTS=(
"./scripts/upgrade/v_6_4_8/setup-08-wasm.sh"
"./scripts/upgrade/v_6_6_0/setup-08-wasm.sh"
)

for SCRIPT in "${ADDITIONAL_SCRIPTS[@]}"; do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
FORK=${FORK:-"false"}


BINARY=_build/old/centaurid
BINARY=_build/old/picad
HOME=mytestnet
ROOT=$(pwd)
DENOM=ppica
Expand All @@ -15,10 +15,12 @@ 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
screen -L -dmS node1 bash scripts/upgrade/localnode.sh $BINARY $DENOM --Logfile $HOME/log-screen.txt

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

sleep 4 # wait for note to start
sleep 20 # wait for note to start

# execute additional pre scripts
source $ADDITIONAL_PRE_SCRIPTS
Expand Down
19 changes: 0 additions & 19 deletions scripts/upgrade/v6_to_7/post_08_wasm.sh

This file was deleted.

18 changes: 0 additions & 18 deletions scripts/upgrade/v6_to_7/pre_08_wasm.sh

This file was deleted.

40 changes: 0 additions & 40 deletions scripts/upgrade/v_6_4_8/post-script-ibc-transfer.sh

This file was deleted.

91 changes: 0 additions & 91 deletions scripts/upgrade/v_6_4_8/post-script.sh

This file was deleted.

35 changes: 0 additions & 35 deletions scripts/upgrade/v_6_4_8/pre-script-ibc-transfer.sh

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ KEY=mykey
KEYALGO="secp256k1"
KEYRING="test"
HOME_DIR="mytestnet"
BINARY=_build/old/centaurid
BINARY=_build/old/picad
DENOM=ppica
CHAINID=centauri-dev

Expand Down

0 comments on commit 16c0213

Please sign in to comment.