diff --git a/starship/charts/devnet/scripts/neutron/create-neutron-genesis.sh b/starship/charts/devnet/scripts/neutron/create-neutron-genesis.sh index 1d26d65e..48f86608 100644 --- a/starship/charts/devnet/scripts/neutron/create-neutron-genesis.sh +++ b/starship/charts/devnet/scripts/neutron/create-neutron-genesis.sh @@ -14,11 +14,6 @@ FAUCET_ENABLED="${FAUCET_ENABLED:=true}" NUM_VALIDATORS="${NUM_VALIDATORS:=1}" NUM_RELAYERS="${NUM_RELAYERS:=0}" -P2PPORT=${P2PPORT:-26656} -RPCPORT=${RPCPORT:-26657} -RESTPORT=${RESTPORT:-1317} -ROSETTA=${ROSETTA:-8080} - GENESIS_PATH="$CHAIN_DIR/config/genesis.json" CONTRACTS_BINARIES_DIR=${CONTRACTS_BINARIES_DIR:-./contracts} @@ -72,28 +67,6 @@ echo "Adding key.... demowallet2" jq -r ".keys[0].mnemonic" $KEYS_CONFIG | $BINARY keys add demowallet3 --index 3 --recover --keyring-backend="test" $BINARY add-genesis-account $($BINARY keys show -a demowallet3 --keyring-backend="test") $COINS --keyring-backend="test" -sed -i -e 's/timeout_commit = "5s"/timeout_commit = "1s"/g' "$CHAIN_DIR/config/config.toml" -sed -i -e 's/timeout_propose = "3s"/timeout_propose = "1s"/g' "$CHAIN_DIR/config/config.toml" -sed -i -e 's/index_all_keys = false/index_all_keys = true/g' "$CHAIN_DIR/config/config.toml" -sed -i -e 's/enable = false/enable = true/g' "$CHAIN_DIR/config/app.toml" -sed -i -e 's/swagger = false/swagger = true/g' "$CHAIN_DIR/config/app.toml" -sed -i -e "s/minimum-gas-prices = \"\"/minimum-gas-prices = \"0$STAKEDENOM\"/g" "$CHAIN_DIR/config/app.toml" -sed -i -e 's/enabled = false/enabled = true/g' "$CHAIN_DIR/config/app.toml" -sed -i -e 's/prometheus-retention-time = 0/prometheus-retention-time = 1000/g' "$CHAIN_DIR/config/app.toml" -sed -i -e 's/enabled-unsafe-cors = false/enabled-unsafe-cors = true/g' "$CHAIN_DIR/config/app.toml" - -sed -i -e 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:'"$P2PPORT"'"#g' "$CHAIN_DIR/config/config.toml" -sed -i -e 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:'"$RPCPORT"'"#g' "$CHAIN_DIR/config/config.toml" -sed -i -e 's#"tcp://localhost:1317"#"tcp://0.0.0.0:'"$RESTPORT"'"#g' "$CHAIN_DIR/config/app.toml" -sed -i -e 's#"tcp://0.0.0.0:1317"#"tcp://0.0.0.0:'"$RESTPORT"'"#g' "$CHAIN_DIR/config/app.toml" -sed -i -e 's#":8080"#":'"$ROSETTA"'"#g' "$CHAIN_DIR/config/app.toml" -sed -i -e 's#localhost#0.0.0.0#g' "$CHAIN_DIR/config/app.toml" - -echo "Update client.toml file" -sed -i -e 's#keyring-backend = "os"#keyring-backend = "test"#g' $CHAIN_DIR/config/client.toml -sed -i -e 's#output = "text"#output = "json"#g' $CHAIN_DIR/config/client.toml -sed -i -e "s#chain-id = \"\"#chain-id = \"$CHAIN_ID\"#g" $CHAIN_DIR/config/client.toml - echo "Update genesis.json file with updated local params" sed -i "s/\"time_iota_ms\": \".*\"/\"time_iota_ms\": \"$TIME_IOTA_MS\"/" $CHAIN_DIR/config/genesis.json diff --git a/starship/charts/devnet/scripts/neutron/update-config.sh b/starship/charts/devnet/scripts/neutron/update-config.sh index f1cfe19f..7439243a 100644 --- a/starship/charts/devnet/scripts/neutron/update-config.sh +++ b/starship/charts/devnet/scripts/neutron/update-config.sh @@ -5,8 +5,33 @@ CHAIN_ID="${CHAIN_ID:=osmosis}" CHAIN_DIR="${CHAIN_DIR:=$HOME/.osmosisd}" KEYS_CONFIG="${KEYS_CONFIG:=configs/keys.json}" +P2PPORT=${P2PPORT:-26656} +RPCPORT=${RPCPORT:-26657} +RESTPORT=${RESTPORT:-1317} +ROSETTA=${ROSETTA:-8080} + set -eux ls $CHAIN_DIR -echo "Already done" +sed -i -e 's/timeout_commit = "5s"/timeout_commit = "1s"/g' "$CHAIN_DIR/config/config.toml" +sed -i -e 's/timeout_propose = "3s"/timeout_propose = "1s"/g' "$CHAIN_DIR/config/config.toml" +sed -i -e 's/index_all_keys = false/index_all_keys = true/g' "$CHAIN_DIR/config/config.toml" +sed -i -e 's/enable = false/enable = true/g' "$CHAIN_DIR/config/app.toml" +sed -i -e 's/swagger = false/swagger = true/g' "$CHAIN_DIR/config/app.toml" +sed -i -e "s/minimum-gas-prices = \"\"/minimum-gas-prices = \"0$STAKEDENOM\"/g" "$CHAIN_DIR/config/app.toml" +sed -i -e 's/enabled = false/enabled = true/g' "$CHAIN_DIR/config/app.toml" +sed -i -e 's/prometheus-retention-time = 0/prometheus-retention-time = 1000/g' "$CHAIN_DIR/config/app.toml" +sed -i -e 's/enabled-unsafe-cors = false/enabled-unsafe-cors = true/g' "$CHAIN_DIR/config/app.toml" + +sed -i -e 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:'"$P2PPORT"'"#g' "$CHAIN_DIR/config/config.toml" +sed -i -e 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:'"$RPCPORT"'"#g' "$CHAIN_DIR/config/config.toml" +sed -i -e 's#"tcp://localhost:1317"#"tcp://0.0.0.0:'"$RESTPORT"'"#g' "$CHAIN_DIR/config/app.toml" +sed -i -e 's#"tcp://0.0.0.0:1317"#"tcp://0.0.0.0:'"$RESTPORT"'"#g' "$CHAIN_DIR/config/app.toml" +sed -i -e 's#":8080"#":'"$ROSETTA"'"#g' "$CHAIN_DIR/config/app.toml" +sed -i -e 's#localhost#0.0.0.0#g' "$CHAIN_DIR/config/app.toml" + +echo "Update client.toml file" +sed -i -e 's#keyring-backend = "os"#keyring-backend = "test"#g' $CHAIN_DIR/config/client.toml +sed -i -e 's#output = "text"#output = "json"#g' $CHAIN_DIR/config/client.toml +sed -i -e "s#chain-id = \"\"#chain-id = \"$CHAIN_ID\"#g" $CHAIN_DIR/config/client.toml diff --git a/starship/charts/devnet/templates/chains/cosmos/validator.yaml b/starship/charts/devnet/templates/chains/cosmos/validator.yaml index 00d7fa6b..cdeed356 100644 --- a/starship/charts/devnet/templates/chains/cosmos/validator.yaml +++ b/starship/charts/devnet/templates/chains/cosmos/validator.yaml @@ -173,6 +173,43 @@ spec: name: addresses - mountPath: /scripts name: scripts + {{- if $chain.ics.enabled }} + {{ $icsChain := include "devnet.fullchain" (dict "name" $chain.ics.provider "file" $defaultFile "context" $) | fromJson }} + - name: init-ics + image: {{ $icsChain.image }} + imagePullPolicy: {{ $.Values.images.imagePullPolicy }} + env: + {{- include "devnet.defaultEvnVars" $chain | indent 12 }} + {{- include "devnet.evnVars" $chain | indent 12 }} + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: KEYS_CONFIG + value: /configs/keys.json + command: + - bash + - "-c" + - | + VAL_INDEX=${HOSTNAME##*-} + echo "Validator Index: $VAL_INDEX" + + echo "Fetching priv keys from provider exposer" + curl -s http://{{ $icsChain.hostname }}-validator-$VAL_INDEX.{{ $icsChain.hostname }}-validator.$NAMESPACE.svc.cluster.local:8081/priv_keys | jq > $CHAIN_DIR/config/provider_priv_validator_key.json + cat $CHAIN_DIR/config/provider_priv_validator_key.json + + echo "Replace provider priv validator key with provider keys" + mv $CHAIN_DIR/config/priv_validator_key.json $CHAIN_DIR/config/previous_priv_validator_key.json + mv $CHAIN_DIR/config/provider_priv_validator_key.json $CHAIN_DIR/config/priv_validator_key.json + resources: {{- include "devnet.node.resources" ( dict "node" $chain "context" $ ) | trim | nindent 12 }} + volumeMounts: + - mountPath: {{ $chain.home }} + name: node + - mountPath: /configs + name: addresses + - mountPath: /scripts + name: scripts + {{- end }} containers: - name: validator image: {{ $chain.image }} @@ -207,7 +244,7 @@ spec: $CHAIN_BIN start $START_ARGS {{- end }} {{/*If cometmock is enabled, then validator is initialized in hook of cometmock statefulset*/}} - {{- if not ($chain.cometmock.enabled) }} + {{- if and (not $chain.cometmock.enabled) (not $chain.ics.enabled) }} lifecycle: postStart: exec: diff --git a/starship/tests/e2e/configs/neutron-relayer.yaml b/starship/tests/e2e/configs/neutron-relayer.yaml index 7679ca80..d8e370ec 100644 --- a/starship/tests/e2e/configs/neutron-relayer.yaml +++ b/starship/tests/e2e/configs/neutron-relayer.yaml @@ -13,7 +13,7 @@ chains: exposer: 38083 - id: cosmoshub-4 name: cosmoshub - numValidators: 2 + numValidators: 1 ports: rest: 1317 rpc: 26657