Skip to content

Commit

Permalink
fix: evmos injective multi node (#246)
Browse files Browse the repository at this point in the history
* add support for starship-faucet in helm, add tests

* add 2 sec sleep after credit test

* add vals for evmos and injective, update validator name

* fix create-validator scripts to use keyring-backend
  • Loading branch information
Anmol1696 authored Sep 16, 2023
1 parent cadc4a0 commit c5aad21
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
6 changes: 5 additions & 1 deletion charts/devnet/scripts/create-validator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CHAIN_BIN="${CHAIN_BIN:=osmosisd}"
KEYS_CONFIG="${KEYS_CONFIG:=configs/keys.json}"
VAL_NAME="${VAL_NAME:=osmosis}"

set -eu
set -eux

# Wait for the node to be synced
max_tries=10
Expand Down Expand Up @@ -54,6 +54,7 @@ function cosmos-sdk-version-v50() {
--chain-id $CHAIN_ID \
--from $VAL_NAME \
--fees 100000$DENOM \
--keyring-backend="test" \
--gas="auto" \
--gas-adjustment 1.5 --yes > /validator.log

Expand All @@ -73,16 +74,19 @@ function cosmos-sdk-version-default() {
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1000000" \
--keyring-backend="test" \
--fees 100000$DENOM \
--gas="auto" \
--gas-adjustment 1.5 --yes > /validator.log

cat /validator.log | jq
}

set +e
# Fetch the cosmos-sdk version to be able to perform the create-validator tx
cosmos_sdk_version=$($CHAIN_BIN version --long | sed -n 's/cosmos_sdk_version: \(.*\)/\1/p')
echo "cosmos_sdk_version: $cosmos_sdk_version"
set -e

if is_greater "$cosmos_sdk_version" "v0.50.0"; then
echo "cosmos_sdk_version is greater than v0.50.0, running create-validator tx with new format"
Expand Down
6 changes: 3 additions & 3 deletions charts/devnet/templates/chains/cosmos/validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ $chain.name }}-validator
name: {{ include "devnet.chain.name" $chain.name }}-validator
spec:
serviceName: {{ $chain.name }}-validator
serviceName: {{ include "devnet.chain.name" $chain.name }}-validator
podManagementPolicy: Parallel
replicas: {{ sub $chain.numValidators 1 }}
revisionHistoryLimit: 3
Expand Down Expand Up @@ -189,7 +189,7 @@ spec:
echo "Transfer tokens to address $VAL_ADDR before trying to create validator. Best effort"
bash -e /scripts/transfer-tokens.sh $VAL_ADDR $DENOM http://$GENESIS_HOST.$NAMESPACE.svc.cluster.local:8000/credit || true
$CHAIN_BIN keys list | jq
$CHAIN_BIN keys list --keyring-backend test | jq
VAL_NAME=$VAL_NAME bash -e /scripts/create-validator.sh
resources: {{- include "devnet.node.resources" ( dict "node" $chain "context" $ ) | trim | nindent 12 }}
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/configs/evmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ chains:
- name: evmos_9000-1
type: evmos
image: ghcr.io/cosmology-tech/starship/evmos:v13.0.2
numValidators: 1
numValidators: 2
faucet:
type: starship
ports:
Expand All @@ -17,7 +17,7 @@ chains:
rest: 1317
rpc: 26657
exposer: 38087
faucet: 8000
faucet: 8007

relayers:
- name: evmos-cosmos
Expand Down
5 changes: 3 additions & 2 deletions tests/e2e/configs/injective.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
chains:
- name: injective-1
type: injective
numValidators: 1
numValidators: 2
faucet:
type: starship
ports:
rest: 1313
rpc: 26653
exposer: 38083
faucet: 8003
- name: cosmoshub-4
type: cosmos
numValidators: 1
ports:
rest: 1317
rpc: 26657
exposer: 38087
faucet: 8000
faucet: 8007

relayers:
- name: injective-cosmos
Expand Down

0 comments on commit c5aad21

Please sign in to comment.