forked from ComposableFi/picasso
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
186 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,4 +51,5 @@ go.work.sum | |
|
||
_build | ||
|
||
screenlog.0 | ||
screenlog.0 | ||
mytestnet |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package v7_0_0 | ||
|
||
import ( | ||
store "cosmossdk.io/store/types" | ||
"github.com/notional-labs/composable/v6/app/upgrades" | ||
) | ||
|
||
const ( | ||
// UpgradeName defines the on-chain upgrade name for the composable upgrade. | ||
UpgradeName = "v7_0_0" | ||
) | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
CreateUpgradeHandler: CreateUpgradeHandler, | ||
StoreUpgrades: store.StoreUpgrades{ | ||
Added: []string{}, | ||
Deleted: []string{"alliance"}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package v7_0_0 | ||
|
||
import ( | ||
"context" | ||
|
||
upgradetypes "cosmossdk.io/x/upgrade/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
|
||
"github.com/cosmos/cosmos-sdk/codec" | ||
"github.com/notional-labs/composable/v6/app/keepers" | ||
"github.com/notional-labs/composable/v6/app/upgrades" | ||
) | ||
|
||
func CreateUpgradeHandler( | ||
mm *module.Manager, | ||
configurator module.Configurator, | ||
_ upgrades.BaseAppParamManager, | ||
_ codec.Codec, | ||
keepers *keepers.AppKeepers, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
return mm.RunMigrations(ctx, configurator, vm) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#!/bin/bash | ||
|
||
echo "starting localnode" | ||
|
||
BINARY=$1 | ||
CONTINUE=${CONTINUE:-"false"} | ||
HOME_DIR=mytestnet | ||
ENV=${ENV:-""} | ||
|
||
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 | ||
|
||
# check BINARY is set. If not, build centaurid and set BINARY | ||
if [ -z "$BINARY" ]; then | ||
make build | ||
BINARY=build/centaurid | ||
fi | ||
|
||
CHAIN_ID="localpica" | ||
KEYRING="test" | ||
KEY="test0" | ||
KEY1="test1" | ||
KEY2="test2" | ||
|
||
# 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 | ||
} | ||
|
||
$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 | ||
|
||
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["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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters