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

fix: make consumer-democracy read the sovereign genesis from nodeHome #2354

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
8 changes: 2 additions & 6 deletions app/consumer-democracy/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"cosmossdk.io/x/feegrant"
feegrantkeeper "cosmossdk.io/x/feegrant/keeper"
feegrantmodule "cosmossdk.io/x/feegrant/module"

// add mint
"cosmossdk.io/x/upgrade"
upgradekeeper "cosmossdk.io/x/upgrade/keeper"
Expand Down Expand Up @@ -681,12 +682,7 @@ func New(
// upgrade handler code is application specific. However, as an example, standalone to consumer
// changeover chains should utilize customized upgrade handler code similar to below.

// TODO: should have a way to read from current node home
userHomeDir, err := os.UserHomeDir()
if err != nil {
stdlog.Println("Failed to get home dir %2", err)
}
nodeHome := userHomeDir + "/.sovereign/config/genesis.json"
nodeHome := homePath + "/.sovereign/config/genesis.json"
appState, _, err := genutiltypes.GenesisStateFromGenFile(nodeHome)
if err != nil {
return fromVM, fmt.Errorf("failed to unmarshal genesis state: %w", err)
Expand Down
16 changes: 9 additions & 7 deletions tests/e2e/testnet-scripts/start-changeover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ TENDERMINT_CONFIG_TRANSFORM=$6
echo "killing nodes"
pkill -f "^"interchain-security-sd &> /dev/null || true

mkdir -p /root/.sovereign/config

# apply genesis changes to existing genesis -> this creates the changeover genesis file with initial validator set
jq "$GENESIS_TRANSFORM" /sover/validatoralice/config/genesis.json > /root/.sovereign/config/genesis.json


# Get number of nodes from length of validators array
NODES=$(echo "$VALIDATORS" | jq '. | length')

for i in $(seq 0 $(($NODES - 1)));
do
VAL_ID=$(echo "$VALIDATORS" | jq -r ".[$i].val_id")
mkdir -p /$CHAIN_ID/validator$VAL_ID/.sovereign/config
# apply genesis changes to existing genesis -> this creates the changeover genesis file with initial validator set
jq "$GENESIS_TRANSFORM" /sover/validatoralice/config/genesis.json > /$CHAIN_ID/validator$VAL_ID/.sovereign/config/genesis.json
done

# SETUP NETWORK NAMESPACES, see: https://adil.medium.com/container-networking-under-the-hood-network-namespaces-6b2b8fe8dc2a

# Create virtual bridge device (acts like a switch)
Expand Down Expand Up @@ -184,4 +186,4 @@ set -e

echo "done!!!!!!!!"

read -p "Press Return to Close..."
read -p "Press Return to Close..."
Loading