Skip to content

Commit

Permalink
fix: make consumer-democracy read the sovereign genesis from nodeHome (
Browse files Browse the repository at this point in the history
  • Loading branch information
fastfadingviolets authored Nov 11, 2024
1 parent b11da1b commit 8219ff3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
7 changes: 1 addition & 6 deletions app/consumer-democracy/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,12 +681,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..."

0 comments on commit 8219ff3

Please sign in to comment.