diff --git a/.github/actions/e2e-test/action.yaml b/.github/actions/e2e-test/action.yaml index 630ab277..bc51f989 100644 --- a/.github/actions/e2e-test/action.yaml +++ b/.github/actions/e2e-test/action.yaml @@ -65,14 +65,14 @@ runs: - name: Setup Test infra id: starship-action - uses: cosmology-tech/starship-action@dda9039c44960084db5955b3ad4720b2255da430 + uses: cosmology-tech/starship-action@0.2.19 with: values: ${{ env.CONFIG_FILE }} port-forward: true version: 0.0.0 chart: ./charts/devnet kubeconfig: ${{ steps.kubeconfig.outputs.content }} - cli-version: d60aa2158bbcd43a3ed8ab3558f50f9618677e05 + cli-version: f35dc85407b350077765a0b3c17a4c1632c7d53c - name: Run tests run: | diff --git a/.github/workflows/pr-tests.yaml b/.github/workflows/pr-tests.yaml index 1c516e48..b97cccb9 100644 --- a/.github/workflows/pr-tests.yaml +++ b/.github/workflows/pr-tests.yaml @@ -45,13 +45,13 @@ jobs: - name: Setup Test infra id: starship-action - uses: cosmology-tech/starship-action@dda9039c44960084db5955b3ad4720b2255da430 + uses: cosmology-tech/starship-action@0.2.19 with: values: ${{ env.CONFIG_FILE }} port-forward: true version: 0.0.0 chart: ./charts/devnet - cli-version: d60aa2158bbcd43a3ed8ab3558f50f9618677e05 + cli-version: f35dc85407b350077765a0b3c17a4c1632c7d53c - name: Run tests run: | diff --git a/.github/workflows/smoke-tests.yaml b/.github/workflows/smoke-tests.yaml index 9d5f4ccf..25fb636f 100644 --- a/.github/workflows/smoke-tests.yaml +++ b/.github/workflows/smoke-tests.yaml @@ -29,14 +29,14 @@ jobs: - name: Setup Test infra id: starship-action - uses: cosmology-tech/starship-action@dda9039c44960084db5955b3ad4720b2255da430 + uses: cosmology-tech/starship-action@0.2.19 with: values: ${{ env.CONFIG_FILE }} port-forward: true version: 0.0.0 chart: ./charts/devnet timeout: 10m - cli-version: d60aa2158bbcd43a3ed8ab3558f50f9618677e05 + cli-version: f35dc85407b350077765a0b3c17a4c1632c7d53c # todo: change this to be post step of the action - name: Cleanup cluster @@ -67,14 +67,14 @@ jobs: - name: Setup Test infra id: starship-action - uses: cosmology-tech/starship-action@dda9039c44960084db5955b3ad4720b2255da430 + uses: cosmology-tech/starship-action@0.2.19 with: values: ${{ env.CONFIG_FILE }} port-forward: true version: 0.0.0 chart: ./charts/devnet timeout: 10m - cli-version: d60aa2158bbcd43a3ed8ab3558f50f9618677e05 + cli-version: f35dc85407b350077765a0b3c17a4c1632c7d53c # todo: change this to be post step of the action - name: Cleanup cluster @@ -105,14 +105,14 @@ jobs: - name: Setup Test infra id: starship-action - uses: cosmology-tech/starship-action@dda9039c44960084db5955b3ad4720b2255da430 + uses: cosmology-tech/starship-action@0.2.19 with: values: ${{ env.CONFIG_FILE }} port-forward: true version: 0.0.0 chart: ./charts/devnet timeout: 10m - cli-version: d60aa2158bbcd43a3ed8ab3558f50f9618677e05 + cli-version: f35dc85407b350077765a0b3c17a4c1632c7d53c # todo: change this to be post step of the action - name: Cleanup cluster diff --git a/charts/devnet/Chart.yaml b/charts/devnet/Chart.yaml index fe9f2457..c3ab4688 100644 --- a/charts/devnet/Chart.yaml +++ b/charts/devnet/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.49-rc1 +version: 0.2.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/devnet/templates/_chains.tpl b/charts/devnet/templates/_chains.tpl index b6010109..1dce9879 100644 --- a/charts/devnet/templates/_chains.tpl +++ b/charts/devnet/templates/_chains.tpl @@ -8,18 +8,18 @@ Usage: {{- required "default file must have setup" $defaultFile.defaultChains -}} {{- $chain := dict -}} {{- range $chainIter := $.context.Values.chains -}} -{{- if eq $chainIter.name $.name -}} +{{- if eq $chainIter.id $.name -}} {{- $chain = $chainIter | deepCopy -}} {{- end }} {{- end }} -{{- required "chain need to exist" $chain.type -}} +{{- required "chain need to exist" $chain.id -}} -{{- $defaultChain := get $defaultFile.defaultChains $chain.type | default dict -}} +{{- $defaultChain := get $defaultFile.defaultChains $chain.name | default dict -}} {{/* merge defaultChain values into the $chain dict*/}} {{- $chain = merge $chain $defaultChain -}} -{{ $_ := set $chain "hostname" (include "devnet.chain.name" $chain.name) }} +{{ $_ := set $chain "hostname" (include "devnet.chain.name" $chain.id) }} {{- $faucet := get $chain "faucet" | default dict -}} {{- $faucet = mergeOverwrite ($.context.Values.faucet | deepCopy) $faucet -}} diff --git a/charts/devnet/templates/_helpers.tpl b/charts/devnet/templates/_helpers.tpl index 5ff63e2d..f5d45b29 100644 --- a/charts/devnet/templates/_helpers.tpl +++ b/charts/devnet/templates/_helpers.tpl @@ -51,7 +51,7 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* -Convert $chain.name to name usable by templates +Convert $chain.id to name usable by templates */}} {{- define "devnet.chain.name" -}} {{- printf "%s" . | replace "_" "-" | trunc 63 }} @@ -82,7 +82,7 @@ Environment variables for chain from configmaps */}} {{- define "devnet.evnVars" }} - name: CHAIN_ID - value: {{ .name }} + value: {{ .id }} {{- end }} {{/* @@ -159,7 +159,7 @@ Returns a comma seperated list of chain id {{- define "devnet.chains.ids" -}} {{- $values := list -}} {{- range $chain := .Values.chains -}} - {{- $values = $chain.name | append $values -}} + {{- $values = $chain.id | append $values -}} {{- end -}} {{ join "," $values }} {{- end -}} @@ -170,7 +170,7 @@ Returns a comma seperated list of urls for the RPC address based on internal DNS {{- define "devnet.chains.internal.rpc.addrs" -}} {{- $values := list -}} {{- range $chain := .Values.chains -}} - {{- $host := include "devnet.chain.name" $chain.name }} + {{- $host := include "devnet.chain.name" $chain.id }} {{- $values = printf "http://%s-genesis.$(NAMESPACE).svc.cluster.local:26657" $host | append $values -}} {{- end -}} {{ join "," $values }} @@ -186,9 +186,9 @@ Returns a comma seperated list of urls for the RPC address {{- if and ($localhost) (($chain.ports).rpc) -}} {{- $values = printf "http://localhost:%v" $chain.ports.rpc | append $values -}} {{- else if $.Values.ingress.enabled }} - {{- $values = printf "https://rpc.%s-genesis.%s" $chain.name ($.Values.ingress.host | replace "*." "") | append $values -}} + {{- $values = printf "https://rpc.%s-genesis.%s" $chain.id ($.Values.ingress.host | replace "*." "") | append $values -}} {{- else -}} - {{- $host := include "devnet.chain.name" $chain.name }} + {{- $host := include "devnet.chain.name" $chain.id }} {{- $values = printf "http://%s-genesis.$(NAMESPACE).svc.cluster.local:26657" $host | append $values -}} {{- end -}} {{- end -}} @@ -206,9 +206,9 @@ If registry.localhost is set to true, then use $chain ports {{- if and ($localhost) (($chain.ports).grpc) -}} {{- $values = printf "http://localhost:%v" $chain.ports.grpc | append $values -}} {{- else if $.Values.ingress.enabled }} - {{- $values = printf "https://grpc.%s-genesis.%s" $chain.name ($.Values.ingress.host | replace "*." "") | append $values -}} + {{- $values = printf "https://grpc.%s-genesis.%s" $chain.id ($.Values.ingress.host | replace "*." "") | append $values -}} {{- else -}} - {{- $host := include "devnet.chain.name" $chain.name }} + {{- $host := include "devnet.chain.name" $chain.id }} {{- $values = printf "http://%s-genesis.$(NAMESPACE).svc.cluster.local:9091" $host | append $values -}} {{- end -}} {{- end -}} @@ -226,9 +226,9 @@ If registry.localhost is set to true, then use $chain ports {{- if and ($localhost) (($chain.ports).rest) -}} {{- $values = printf "http://localhost:%v" $chain.ports.rest | append $values -}} {{- else if $.Values.ingress.enabled }} - {{- $values = printf "https://rest.%s-genesis.%s" $chain.name ($.Values.ingress.host | replace "*." "") | append $values -}} + {{- $values = printf "https://rest.%s-genesis.%s" $chain.id ($.Values.ingress.host | replace "*." "") | append $values -}} {{- else -}} - {{- $host := include "devnet.chain.name" $chain.name }} + {{- $host := include "devnet.chain.name" $chain.id }} {{- $values = printf "http://%s-genesis.$(NAMESPACE).svc.cluster.local:1317" $host | append $values -}} {{- end -}} {{- end -}} @@ -242,7 +242,7 @@ Returns a comma seperated list of urls for the Exposer address {{- $port := ($.Values.exposer.ports.rest | toString | default "8081") }} {{- $values := list -}} {{- range $chain := .Values.chains -}} - {{- $host := include "devnet.chain.name" $chain.name }} + {{- $host := include "devnet.chain.name" $chain.id }} {{- $values = printf "http://%s-genesis.$(NAMESPACE).svc.cluster.local:%s" $host $port | append $values -}} {{- end -}} {{ join "," $values }} diff --git a/charts/devnet/templates/chains/cosmos/cometmock.yaml b/charts/devnet/templates/chains/cosmos/cometmock.yaml index 36ea9c08..68bae1e7 100644 --- a/charts/devnet/templates/chains/cosmos/cometmock.yaml +++ b/charts/devnet/templates/chains/cosmos/cometmock.yaml @@ -1,9 +1,9 @@ {{- range $chain := .Values.chains }} -{{- if ne $chain.type "virtual" }} -{{ $dataExposer := dict "chain" $chain.name "port" ($.Values.exposer.ports.rest | quote | default "8081") }} +{{- if ne $chain.name "virtual" }} +{{ $dataExposer := dict "chain" $chain.id "port" ($.Values.exposer.ports.rest | quote | default "8081") }} {{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} -{{ $chain := include "devnet.fullchain" (dict "name" $chain.name "file" $defaultFile "context" $) | fromJson }} +{{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }} {{- if ($chain.cometmock.enabled) }} --- @@ -12,7 +12,7 @@ kind: Service metadata: name: {{ $chain.hostname }}-cometmock labels: - app.kubernetes.io/name: {{ $chain.name }}-cometmock + app.kubernetes.io/name: {{ $chain.id }}-cometmock spec: clusterIP: None ports: @@ -21,7 +21,7 @@ spec: protocol: TCP targetPort: 22331 selector: - app.kubernetes.io/name: {{ $chain.name }}-cometmock + app.kubernetes.io/name: {{ $chain.id }}-cometmock --- apiVersion: apps/v1 kind: StatefulSet @@ -33,8 +33,8 @@ spec: revisionHistoryLimit: 3 selector: matchLabels: - app.kubernetes.io/instance: {{ $chain.type }} - app.kubernetes.io/name: {{ $chain.name }}-cometmock + app.kubernetes.io/instance: {{ $chain.name }} + app.kubernetes.io/name: {{ $chain.id }}-cometmock template: metadata: annotations: @@ -43,10 +43,10 @@ spec: sla: high tier: gateway labels: - app.kubernetes.io/instance: {{ $chain.type }} + app.kubernetes.io/instance: {{ $chain.name }} app.kubernetes.io/type: cometmock - app.kubernetes.io/name: {{ $chain.name }}-cometmock - app.kubernetes.io/rawname: {{ $chain.name }}-cometmock + app.kubernetes.io/name: {{ $chain.id }}-cometmock + app.kubernetes.io/rawname: {{ $chain.id }}-cometmock app.kubernetes.io/version: {{ $.Chart.AppVersion }} spec: {{- include "imagePullSecrets" $chain | indent 6 }} @@ -98,7 +98,7 @@ spec: - "-c" - | while [ $(curl -sw '%{http_code}' http://{{ $chain.hostname }}-genesis.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_keys -o /dev/null) -ne 200 ]; do - echo "Genesis validator does not seem to be ready for: {{ $chain.name }}. Waiting for it to start..." + echo "Genesis validator does not seem to be ready for: {{ $chain.id }}. Waiting for it to start..." echo "Checking: http://{{ $chain.hostname }}-genesis.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_keys" sleep 10; done @@ -106,7 +106,7 @@ spec: for i in $(seq 0 {{ sub $chain.numValidators 2 }}); do while [ $(curl -sw '%{http_code}' http://{{ $chain.hostname }}-validator-$i.{{ $chain.hostname }}-validator.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_keys -o /dev/null) -ne 200 ]; do - echo "Validator does not seem to be ready for: {{ $chain.name }} validator-$i. Waiting for it to start..." + echo "Validator does not seem to be ready for: {{ $chain.id }} validator-$i. Waiting for it to start..." echo "Checking: http://{{ $chain.hostname }}-validator-$i.{{ $chain.hostname }}-validator.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_keys" sleep 10; done diff --git a/charts/devnet/templates/chains/cosmos/configmap.yaml b/charts/devnet/templates/chains/cosmos/configmap.yaml index 9284df9b..ad20e222 100644 --- a/charts/devnet/templates/chains/cosmos/configmap.yaml +++ b/charts/devnet/templates/chains/cosmos/configmap.yaml @@ -1,7 +1,7 @@ {{- range $chain := .Values.chains }} -{{- if ne $chain.type "virtual" }} +{{- if ne $chain.name "virtual" }} {{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} -{{ $chain := include "devnet.fullchain" (dict "name" $chain.name "file" $defaultFile "context" $) | fromJson }} +{{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }} --- apiVersion: v1 kind: ConfigMap diff --git a/charts/devnet/templates/chains/cosmos/genesis.yaml b/charts/devnet/templates/chains/cosmos/genesis.yaml index 7916b6e5..9968ea39 100644 --- a/charts/devnet/templates/chains/cosmos/genesis.yaml +++ b/charts/devnet/templates/chains/cosmos/genesis.yaml @@ -1,9 +1,9 @@ {{- range $chain := .Values.chains }} -{{- if ne $chain.type "virtual" }} -{{ $dataExposer := dict "chain" $chain.name "port" ($.Values.exposer.ports.rest | quote | default "8081") }} +{{- if ne $chain.name "virtual" }} +{{ $dataExposer := dict "chain" $chain.id "port" ($.Values.exposer.ports.rest | quote | default "8081") }} {{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} -{{ $chain := include "devnet.fullchain" (dict "name" $chain.name "file" $defaultFile "context" $) | fromJson }} +{{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }} --- apiVersion: apps/v1 kind: StatefulSet @@ -15,8 +15,8 @@ spec: revisionHistoryLimit: 3 selector: matchLabels: - app.kubernetes.io/instance: {{ $chain.type }} - app.kubernetes.io/name: {{ $chain.name }}-genesis + app.kubernetes.io/instance: {{ $chain.name }} + app.kubernetes.io/name: {{ $chain.id }}-genesis template: metadata: annotations: @@ -25,10 +25,10 @@ spec: sla: high tier: gateway labels: - app.kubernetes.io/instance: {{ $chain.type }} - app.kubernetes.io/type: {{ $chain.name }} - app.kubernetes.io/name: {{ $chain.name }}-genesis - app.kubernetes.io/rawname: {{ $chain.name }} + app.kubernetes.io/instance: {{ $chain.name }} + app.kubernetes.io/type: {{ $chain.id }} + app.kubernetes.io/name: {{ $chain.id }}-genesis + app.kubernetes.io/rawname: {{ $chain.id }} app.kubernetes.io/version: {{ $.Chart.AppVersion }} spec: {{- include "imagePullSecrets" $chain | indent 6 }} @@ -61,7 +61,7 @@ spec: - name: GOBIN value: /go/bin - name: CHAIN_NAME - value: {{ $chain.name }} + value: {{ $chain.id }} {{ include "devnet.defaultEvnVars" $chain | indent 12 }} resources: {{- include "devnet.node.resources" ( dict "node" $chain "context" $ ) | trim | nindent 12 }} volumeMounts: @@ -319,7 +319,7 @@ spec: - name: FAUCET_CHAIN_BINARY value: "{{ $chain.binary }}" - name: FAUCET_CHAIN_ID - value: "{{ $chain.name }}" + value: "{{ $chain.id }}" - name: COINS value: "{{ $chain.coins }}" command: @@ -376,11 +376,11 @@ spec: name: keys - name: scripts configMap: - name: setup-scripts-{{- include "devnet.chain.name" $chain.name }} + name: setup-scripts-{{- include "devnet.chain.name" $chain.id }} {{- if hasKey $chain "genesis" }} - name: patch configMap: - name: patch-{{- include "devnet.chain.name" $chain.name }} + name: patch-{{- include "devnet.chain.name" $chain.id }} {{- end }} {{- if and ($chain.faucet.enabled) (eq $chain.faucet.type "starship") }} - name: faucet diff --git a/charts/devnet/templates/chains/cosmos/service.yaml b/charts/devnet/templates/chains/cosmos/service.yaml index c5d21d97..ac336665 100644 --- a/charts/devnet/templates/chains/cosmos/service.yaml +++ b/charts/devnet/templates/chains/cosmos/service.yaml @@ -1,16 +1,16 @@ {{ $portMap := dict "p2p" 26656 "address" 26658 "grpc" 9090 "rest" 1317 }} {{- range $chain := .Values.chains }} -{{- if ne $chain.type "virtual" }} +{{- if ne $chain.name "virtual" }} {{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} -{{ $chain := include "devnet.fullchain" (dict "name" $chain.name "file" $defaultFile "context" $) | fromJson }} +{{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }} --- apiVersion: v1 kind: Service metadata: name: {{ $chain.hostname }}-genesis labels: - app.kubernetes.io/name: {{ $chain.name }}-genesis + app.kubernetes.io/name: {{ $chain.id }}-genesis spec: clusterIP: None ports: @@ -39,16 +39,16 @@ spec: protocol: TCP targetPort: 8000 selector: - app.kubernetes.io/name: {{ $chain.name }}-genesis + app.kubernetes.io/name: {{ $chain.id }}-genesis --- {{- if gt $chain.numValidators 1.0}} --- apiVersion: v1 kind: Service metadata: - name: {{ include "devnet.chain.name" $chain.name }}-validator + name: {{ include "devnet.chain.name" $chain.id }}-validator labels: - app.kubernetes.io/name: {{ $chain.name }}-validator + app.kubernetes.io/name: {{ $chain.id }}-validator spec: clusterIP: None ports: @@ -73,7 +73,7 @@ spec: protocol: TCP targetPort: {{ $.Values.exposer.ports.rest | default 8081 }} selector: - app.kubernetes.io/name: {{ $chain.name }}-validator + app.kubernetes.io/name: {{ $chain.id }}-validator --- {{- end }} {{- end }} diff --git a/charts/devnet/templates/chains/cosmos/validator.yaml b/charts/devnet/templates/chains/cosmos/validator.yaml index 62992580..32b41046 100644 --- a/charts/devnet/templates/chains/cosmos/validator.yaml +++ b/charts/devnet/templates/chains/cosmos/validator.yaml @@ -1,12 +1,12 @@ {{- range $chain := .Values.chains }} -{{- if ne $chain.type "virtual" }} +{{- if ne $chain.name "virtual" }} {{- if gt $chain.numValidators 1.0 }} -{{ $dataExposer := dict "chain" $chain.name "port" ($.Values.exposer.ports.rest | quote | default "8081") }} +{{ $dataExposer := dict "chain" $chain.id "port" ($.Values.exposer.ports.rest | quote | default "8081") }} {{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} -{{ $chain := include "devnet.fullchain" (dict "name" $chain.name "file" $defaultFile "context" $) | fromJson }} +{{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }} -{{ $initParams := dict "chains" (list $chain.name) "port" $.Values.exposer.ports.rest "context" $ }} +{{ $initParams := dict "chains" (list $chain.id) "port" $.Values.exposer.ports.rest "context" $ }} --- apiVersion: apps/v1 kind: StatefulSet @@ -19,8 +19,8 @@ spec: revisionHistoryLimit: 3 selector: matchLabels: - app.kubernetes.io/instance: {{ $chain.type }} - app.kubernetes.io/name: {{ $chain.name }}-validator + app.kubernetes.io/instance: {{ $chain.name }} + app.kubernetes.io/name: {{ $chain.id }}-validator template: metadata: annotations: @@ -29,9 +29,9 @@ spec: sla: high tier: gateway labels: - app.kubernetes.io/instance: {{ $chain.type }} - app.kubernetes.io/type: {{ $chain.name }} - app.kubernetes.io/name: {{ $chain.name }}-validator + app.kubernetes.io/instance: {{ $chain.name }} + app.kubernetes.io/type: {{ $chain.id }} + app.kubernetes.io/name: {{ $chain.id }}-validator app.kubernetes.io/version: {{ $.Chart.AppVersion }} spec: {{- include "imagePullSecrets" $chain | indent 6 }} @@ -64,7 +64,7 @@ spec: - name: GOBIN value: /go/bin - name: CHAIN_NAME - value: {{ $chain.name }} + value: {{ $chain.id }} {{ include "devnet.defaultEvnVars" $chain | indent 12 }} resources: {{- include "devnet.node.resources" ( dict "node" $chain "context" $ ) | trim | nindent 12 }} volumeMounts: diff --git a/charts/devnet/templates/chains/virtual/eth/configmap.yaml b/charts/devnet/templates/chains/virtual/eth/configmap.yaml index 31144f0e..eee22c19 100644 --- a/charts/devnet/templates/chains/virtual/eth/configmap.yaml +++ b/charts/devnet/templates/chains/virtual/eth/configmap.yaml @@ -1,5 +1,5 @@ {{- range $chain := .Values.chains }} -{{- if eq $chain.type "virtual" }} +{{- if eq $chain.name "virtual" }} {{- if eq $chain.subtype "eth" }} apiVersion: v1 kind: ConfigMap diff --git a/charts/devnet/templates/chains/virtual/eth/secrets.yaml b/charts/devnet/templates/chains/virtual/eth/secrets.yaml index 7c9d317c..e815fd95 100644 --- a/charts/devnet/templates/chains/virtual/eth/secrets.yaml +++ b/charts/devnet/templates/chains/virtual/eth/secrets.yaml @@ -1,5 +1,5 @@ {{- range $chain := .Values.chains }} -{{- if eq $chain.type "virtual" }} +{{- if eq $chain.name "virtual" }} {{- if eq $chain.subtype "eth" }} apiVersion: v1 diff --git a/charts/devnet/templates/chains/virtual/eth/service.yaml b/charts/devnet/templates/chains/virtual/eth/service.yaml index 7d8b4199..6d49bcec 100644 --- a/charts/devnet/templates/chains/virtual/eth/service.yaml +++ b/charts/devnet/templates/chains/virtual/eth/service.yaml @@ -1,5 +1,5 @@ {{- range $chain := .Values.chains }} -{{- if eq $chain.type "virtual" }} +{{- if eq $chain.name "virtual" }} {{- if eq $chain.subtype "eth" }} apiVersion: v1 diff --git a/charts/devnet/templates/chains/virtual/eth/statefulset.yaml b/charts/devnet/templates/chains/virtual/eth/statefulset.yaml index ec24b75a..20586e88 100644 --- a/charts/devnet/templates/chains/virtual/eth/statefulset.yaml +++ b/charts/devnet/templates/chains/virtual/eth/statefulset.yaml @@ -1,5 +1,5 @@ {{- range $chain := .Values.chains }} -{{- if eq $chain.type "virtual" }} +{{- if eq $chain.name "virtual" }} {{- if eq $chain.subtype "eth" }} {{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} diff --git a/charts/devnet/templates/explorer.yaml b/charts/devnet/templates/explorer.yaml index 747c404d..5dddd761 100644 --- a/charts/devnet/templates/explorer.yaml +++ b/charts/devnet/templates/explorer.yaml @@ -78,20 +78,20 @@ metadata: data: {{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} {{- range $chain := .Values.chains }} - {{ $chain := include "devnet.fullchain" (dict "name" $chain.name "file" $defaultFile "context" $) | fromJson }} + {{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }} {{ $host := "localhost" }} {{- if not $.Values.explorer.localhost }} {{ $host := printf "%s-genesis.%s.svc.cluster.local" $chain.hostname $.Release.Namespace }} {{- end }} - {{ $chain.name }}.json: |- + {{ $chain.id }}.json: |- { - "chain_name": "{{ $chain.name }}", - "coingecko": "{{ $chain.type }}", + "chain_name": "{{ $chain.id }}", + "coingecko": "{{ $chain.name }}", {{- if $.Values.ingress.enabled }} - "api": "https://rest.{{ $chain.name }}-genesis.{{ $.Values.ingress.host | replace "*." "" }}:443", + "api": "https://rest.{{ $chain.id }}-genesis.{{ $.Values.ingress.host | replace "*." "" }}:443", "rpc": [ - "https://rpc.{{ $chain.name }}-genesis.{{ $.Values.ingress.host | replace "*." "" }}:443", - "https://rpc.{{ $chain.name }}-genesis.{{ $.Values.ingress.host | replace "*." "" }}:443" + "https://rpc.{{ $chain.id }}-genesis.{{ $.Values.ingress.host | replace "*." "" }}:443", + "https://rpc.{{ $chain.id }}-genesis.{{ $.Values.ingress.host | replace "*." "" }}:443" ], {{- else }} "api": "http://{{ $host }}:{{ $chain.ports.rest }}", @@ -111,7 +111,7 @@ data: "base": "{{ $chain.denom }}", "symbol": "{{ $chain.prefix | upper }}", "exponent": "6", - "coingecko_id": "{{ $chain.name }}", + "coingecko_id": "{{ $chain.id }}", "logo": "" } ] diff --git a/charts/devnet/templates/ingress/ingress.yaml b/charts/devnet/templates/ingress/ingress.yaml index 53ab08c9..1cd772f6 100644 --- a/charts/devnet/templates/ingress/ingress.yaml +++ b/charts/devnet/templates/ingress/ingress.yaml @@ -26,11 +26,11 @@ spec: {{- end }} {{- range $chain := $.Values.chains }} - hosts: - - "rest.{{ $chain.name }}-genesis.{{ $host }}" - secretName: rest.{{ $chain.name }}-genesis.{{ $.Values.ingress.type }}-ingress-tls + - "rest.{{ $chain.id }}-genesis.{{ $host }}" + secretName: rest.{{ $chain.id }}-genesis.{{ $.Values.ingress.type }}-ingress-tls - hosts: - - "rpc.{{ $chain.name }}-genesis.{{ $host }}" - secretName: rpc.{{ $chain.name }}-genesis.{{ $.Values.ingress.type }}-ingress-tls + - "rpc.{{ $chain.id }}-genesis.{{ $host }}" + secretName: rpc.{{ $chain.id }}-genesis.{{ $.Values.ingress.type }}-ingress-tls {{- end }} rules: {{- if $.Values.explorer.enabled }} @@ -58,38 +58,38 @@ spec: name: http {{- end }} {{- range $chain := $.Values.chains }} - - host: "rest.{{ $chain.name }}-genesis.{{ $host }}" + - host: "rest.{{ $chain.id }}-genesis.{{ $host }}" http: paths: - pathType: ImplementationSpecific path: "/(.*)" backend: service: - name: {{ $chain.name }}-genesis + name: {{ $chain.id }}-genesis port: name: rest - pathType: ImplementationSpecific path: "/faucet/(.*)" backend: service: - name: {{ $chain.name }}-genesis + name: {{ $chain.id }}-genesis port: name: faucet - pathType: ImplementationSpecific path: "/exposer/(.*)" backend: service: - name: {{ $chain.name }}-genesis + name: {{ $chain.id }}-genesis port: name: exposer - - host: "rpc.{{ $chain.name }}-genesis.{{ $host }}" + - host: "rpc.{{ $chain.id }}-genesis.{{ $host }}" http: paths: - pathType: ImplementationSpecific path: "/(.*)" backend: service: - name: {{ $chain.name }}-genesis + name: {{ $chain.id }}-genesis port: name: rpc {{- end }} diff --git a/charts/devnet/templates/monitoring/prometheus.yaml b/charts/devnet/templates/monitoring/prometheus.yaml index 3369140a..623f27e2 100644 --- a/charts/devnet/templates/monitoring/prometheus.yaml +++ b/charts/devnet/templates/monitoring/prometheus.yaml @@ -186,7 +186,7 @@ data: - targets: ['localhost:9090'] {{- range $i, $chain := .Values.chains }} - {{ $fullchain := include "devnet.fullchain" (dict "name" $chain.name "file" $defaultFile "context" $) | fromJson }} + {{ $fullchain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }} {{- if $fullchain.metrics }} - job_name: '{{ $fullchain.name }}-genesis' static_configs: diff --git a/charts/devnet/templates/registry.yaml b/charts/devnet/templates/registry.yaml index 25bdea09..9eb46e94 100644 --- a/charts/devnet/templates/registry.yaml +++ b/charts/devnet/templates/registry.yaml @@ -1,7 +1,7 @@ {{- if .Values.registry.enabled }} {{ $listIDs := list }} {{- range $.Values.chains -}} -{{ $listIDs = .name | append $listIDs }} +{{ $listIDs = .id | append $listIDs }} {{- end }} {{ $initParams := dict "chains" $listIDs "port" $.Values.exposer.ports.rest "context" $ }} --- @@ -81,8 +81,8 @@ spec: {{- include "getResourceObject" .Values.registry.resources | indent 12 }} volumeMounts: {{- range $chain := .Values.chains }} - - mountPath: /configs/{{ $chain.name }} - name: registry-configs-{{- include "devnet.chain.name" $chain.name }} + - mountPath: /configs/{{ $chain.id }} + name: registry-configs-{{- include "devnet.chain.name" $chain.id }} {{- end }} readinessProbe: tcpSocket: @@ -96,14 +96,14 @@ spec: periodSeconds: 10 volumes: {{- range $chain := .Values.chains }} - - name: registry-configs-{{- include "devnet.chain.name" $chain.name }} + - name: registry-configs-{{- include "devnet.chain.name" $chain.id }} configMap: - name: registry-{{- include "devnet.chain.name" $chain.name }} + name: registry-{{- include "devnet.chain.name" $chain.id }} {{- end }} --- {{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} {{- range $chain := .Values.chains }} -{{ $chain := include "devnet.fullchain" (dict "name" $chain.name "file" $defaultFile "context" $) | fromJson }} +{{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }} {{ $host := "localhost" }} {{- if not $.Values.registry.localhost }} {{ $host := printf "%s-genesis.%s.svc.cluster.local" $chain.hostname $.Release.Namespace }} @@ -116,10 +116,10 @@ data: assetlist.json: |- { "$schema": "../assetlist.schema.json", - {{- if eq $chain.type "custom" }} - "chain_name": "{{ $chain.name }}", + {{- if eq $chain.name "custom" }} + "chain_name": "{{ $chain.id }}", {{- else }} - "chain_name": "{{ $chain.type }}", + "chain_name": "{{ $chain.name }}", {{- end }} {{- if hasKey $chain "assets" }} "assets": {{ toJson $chain.assets }} @@ -141,7 +141,7 @@ data: "exponent": 6 } ], - "coingecko_id": "{{ $chain.type }}" + "coingecko_id": "{{ $chain.name }}" } ] {{- end }} @@ -149,14 +149,14 @@ data: chain.json: |- { "$schema": "../chain.schema.json", - {{- if eq $chain.type "custom" }} - "chain_name": "{{ $chain.name }}", + {{- if eq $chain.name "custom" }} + "chain_name": "{{ $chain.id }}", {{- else }} - "chain_name": "{{ $chain.type }}", + "chain_name": "{{ $chain.name }}", {{- end }} "status": "live", "network_type": "mainnet", - "chain_id": "{{ $chain.name }}", + "chain_id": "{{ $chain.id }}", "pretty_name": "{{ $chain.prettyName }}", "bech32_prefix": "{{ $chain.prefix }}", "daemon_name": "{{ $chain.binary }}", diff --git a/charts/devnet/values.schema.json b/charts/devnet/values.schema.json index d88a63ac..aed427c9 100644 --- a/charts/devnet/values.schema.json +++ b/charts/devnet/values.schema.json @@ -105,10 +105,10 @@ "items": { "type": "object", "properties": { - "name": { + "id": { "type": "string" }, - "type": { + "name": { "type": "string", "enum": [ "custom", @@ -497,8 +497,8 @@ }, "additionalProperties": false, "required": [ + "id", "name", - "type", "numValidators" ] } diff --git a/charts/devnet/values.yaml b/charts/devnet/values.yaml index 09461e50..00229567 100644 --- a/charts/devnet/values.yaml +++ b/charts/devnet/values.yaml @@ -45,8 +45,8 @@ timeouts: chains: [] # Examples running chains - # - name: osmosis-1 - # type: osmosis + # - id: osmosis-1 + # name: osmosis # numValidators: 4 # upgrade: # enabled: true @@ -69,8 +69,8 @@ chains: [] # ports: # rpc: 26653 # rest: 1313 - # - name: core-1 - # type: persistencecore + # - id: core-1 + # name: persistencecore # numValidators: 3 # upgrade: # enabled: true @@ -82,8 +82,8 @@ chains: [] # ports: # rpc: 26657 # rest: 1317 - # - name: core-2 - # type: persistencecore + # - id: core-2 + # name: persistencecore # numValidators: 3 # build: # # build directive will instruct the chart to build the chain source from @@ -93,28 +93,28 @@ chains: [] # ports: # rpc: 26658 # rest: 1318 - # - name: juno-1 - # type: juno + # - id: juno-1 + # name: juno # numValidators: 2 # ports: # rpc: 26654 # rest: 1314 - # - name: wasmd - # type: wasmd + # - id: wasmd + # name: wasmd # numValidators: 3 # ports: # rpc: 26659 # rest: 1319 - # - name: osmosis-4 - # type: osmosis + # - id: osmosis-4 + # name: osmosis # numValidators: 2 # # genesis override local to genesis.json # # this genesis directive is converted to a patch.json file # # then then `jq -s '.[0] * .[1]' genesis.json patch.json > genesis.json` is run # genesis: # auth: ... - # - name: osmosis-2 - # type: osmosis + # - id: osmosis-2 + # name: osmosis # numValidators: 2 # # scripts directive will replace the default scripts with the given scripts # # please make sure the current scripts are compatible with Starship diff --git a/clients/go/client/chain.go b/clients/go/client/chain.go index 7b27b428..a91f59c6 100644 --- a/clients/go/client/chain.go +++ b/clients/go/client/chain.go @@ -22,10 +22,10 @@ type ChainClients []*ChainClient func NewChainClients(logger *zap.Logger, config *Config) (ChainClients, error) { var clients []*ChainClient for _, chain := range config.Chains { - client, err := NewChainClient(logger, config, chain.Name) + client, err := NewChainClient(logger, config, chain.ID) if err != nil { logger.Error("unable to create client for chain", - zap.String("chain_id", chain.Name), + zap.String("chain_id", chain.ID), zap.Error(err), ) return nil, err diff --git a/clients/go/client/config.go b/clients/go/client/config.go index 7095ee0e..f52fbe39 100644 --- a/clients/go/client/config.go +++ b/clients/go/client/config.go @@ -5,8 +5,8 @@ import ( ) type Chain struct { + ID string `name:"id" json:"id" yaml:"id"` Name string `name:"name" json:"name" yaml:"name"` - Type string `name:"type" json:"type" yaml:"type"` NumValidators int `name:"num-validators" json:"num_validators" yaml:"numValidators"` Ports Port `name:"ports" json:"ports" yaml:"ports"` Upgrade Upgrade `name:"upgrade" json:"upgrade" yaml:"upgrade"` @@ -71,7 +71,7 @@ type Config struct { // HasChainId returns true if chain id found in list of chains func (c *Config) HasChainId(chainId string) bool { for _, chain := range c.Chains { - if chain.Name == chainId { + if chain.ID == chainId { return true } } @@ -82,7 +82,7 @@ func (c *Config) HasChainId(chainId string) bool { // GetChain returns the Chain object pointer for the given chain id func (c *Config) GetChain(chainId string) *Chain { for _, chain := range c.Chains { - if chain.Name == chainId { + if chain.ID == chainId { return chain } } diff --git a/cmd/starship/model.go b/cmd/starship/model.go index 3d2d07fa..031e7710 100644 --- a/cmd/starship/model.go +++ b/cmd/starship/model.go @@ -6,8 +6,8 @@ import ( ) type Chain struct { + ID string `name:"id" json:"id,omitempty" yaml:"id"` Name string `name:"name" json:"name,omitempty" yaml:"name"` - Type string `name:"type" json:"type,omitempty" yaml:"type"` Image string `name:"image" json:"image,omitempty" yaml:"image"` NumValidators int `name:"num-validators" json:"num_validators,omitempty" yaml:"numValidators"` Scripts map[string]ScriptData `name:"scripts" json:"scripts,omitempty" yaml:"scripts"` @@ -19,7 +19,7 @@ type Chain struct { } func (c *Chain) GetName() string { - return strings.Replace(c.Name, "_", "-", -1) + return strings.Replace(c.ID, "_", "-", -1) } func (c *Chain) GetRPCAddr() string { @@ -119,7 +119,7 @@ type HelmConfig struct { // HasChainId returns true if chain id found in list of chains func (c *HelmConfig) HasChainId(chainId string) bool { for _, chain := range c.Chains { - if chain.Name == chainId { + if chain.ID == chainId { return true } } @@ -130,7 +130,7 @@ func (c *HelmConfig) HasChainId(chainId string) bool { // GetChain returns the Chain object pointer for the given chain id func (c *HelmConfig) GetChain(chainId string) *Chain { for _, chain := range c.Chains { - if chain.Name == chainId { + if chain.ID == chainId { return chain } } diff --git a/docs/pages/config/chains.mdx b/docs/pages/config/chains.mdx index 5e47d46d..ebf95c22 100644 --- a/docs/pages/config/chains.mdx +++ b/docs/pages/config/chains.mdx @@ -2,27 +2,27 @@ Here we will go into details of the `chains` top level directive in the Starship config file. -## `name` -Name of the chain, this is used as the `chain-id` of the chain +## `id` +ID of the chain, this is used as the `chain-id` of the chain ```yaml chains: -- name: osmosis-1 +- id: osmosis-1 ... -- name: gaia-2 +- id: gaia-2 ... -- name: juno-1 +- id: juno-1 ... ``` -## `type` +## `name` Type of chain is a short hand to use the default key values for a chain found [here](https://github.com/cosmology-tech/starship/blob/main/charts/devnet/values.yaml#L54...#L244) ```yaml chains: -- name: osmosis-1 - type: osmosis +- id: osmosis-1 + name: osmosis ... -- name: gaia-2 - type: cosmos +- id: gaia-2 + name: cosmos ... ``` @@ -30,20 +30,20 @@ One can override the default values supported by `defaultChain` by simply mentio Here is how one can set the docker image of the default values ```yaml chains: -- name: osmosis-1 - type: osmosis +- id: osmosis-1 + name: osmosis image: ghcr.io/cosmology-tech/starship/osmosis:v15.0.0 coins: 100000000000000uosmo ... ``` -### `type: custom` +### `name: custom` Optionally one can define the type to `custom`, and pass all the default params directly into the chain directive. This is useful when one is trying setup a chain not supported in the `defaultChains`. ```yaml chains: -- name: osmosis-1 - type: custom +- id: osmosis-1 + name: custom image: ghcr.io/cosmology-tech/starship/osmosis:v15.1.2-wasmvm1.1.2 home: /root/.osmosisd binary: osmosisd @@ -58,12 +58,12 @@ chains: ## `image` (optional) Already mentioned above, but here we will go deeper into how the docker images are used for the chain. By default this value is taken from -the `type` directive. This is the standard way of running chains at specific versions. +the `name` directive. This is the standard way of running chains at specific versions. ```yaml chains: -- name: osmosis-1 - type: osmosis +- id: osmosis-1 + name: osmosis image: "" ... ``` @@ -80,8 +80,8 @@ Number of validators to run for the chain. It must be greater than 1, can go up ```yaml chains: -- name: osmosis-1 - type: osmosis +- id: osmosis-1 + name: osmosis numValidators: 2 ``` @@ -95,8 +95,8 @@ which is 5, then other validators are created with random mnemonic on initializa Ports directive in the `chains` directive is used for `kubectl port-forward` forwarding kubernetes service ports to local host. ```yaml chains: -- name: osmosis-1 - type: osmosis +- id: osmosis-1 + name: osmosis numValidators: 2 ports: rest: 1317 # Rest endpoint of the Genesis validator node (most used) @@ -116,8 +116,8 @@ Available endpoints for extra services: Resource directive is something with which you can control how much resources to provide to each of the chain node. ```yaml chains: -- name: osmosis-1 - type: osmosis +- id: osmosis-1 + name: osmosis numValidators: 1 resources: cpu: 1 # 1 CPU @@ -130,8 +130,8 @@ One can provide fractional cpus and memory as per the resource constraints of th Usually when running in the CI or locally you can provide partial resources like following: ```yaml chains: -- name: osmosis-1 - type: osmosis +- id: osmosis-1 + name: osmosis numValidators: 1 resources: cpu: "0.2" # 0.2 CPU @@ -153,8 +153,8 @@ overridden with this directive, specially for compatible cosmjs version with the ```yaml chains: -- name: osmosis-1 - type: osmosis +- id: osmosis-1 + name: osmosis numValidators: 1 faucet: enabled: true # optional, default is true, need to specify if want to disable faucet, set to false @@ -181,8 +181,8 @@ When the directive is `enabled`, then the docker image is set to a [`runner` doc which is a basic alpine image with starship dependencies. ```yaml chains: -- name: osmosis-1 - type: osmosis +- id: osmosis-1 + name: osmosis numValidators: 2 build: enabled: true @@ -190,15 +190,15 @@ chains: ``` We fetch the source from the `repo` defined in the `defaultChains`. -If you are using the `type: custom`, then you need to specify `repo` directive, from where to get the source. +If you are using the `name: custom`, then you need to specify `repo` directive, from where to get the source. ## `upgrade` (optional) If you want to perform a software upgrade on a chain, then this directive is here help. This will not perform the chain upgrade, but prepare the chain nodes to be able to do an actual software upgrade. ```yaml chains: -- name: osmosis-1 - type: osmosis +- id: osmosis-1 + name: osmosis numValidators: 2 upgrade: enabled: true # enable the directive @@ -219,8 +219,8 @@ Patch `genesis.json` file directly from the config file using this directive. On patch for genesis is applied. ```yaml chains: -- name: osmosis-1 - type: osmosis +- id: osmosis-1 + name: osmosis numValidators: 2 genesis: app_state: @@ -247,8 +247,8 @@ One can choose the sub-scripts that need to be overwritten, default scripts will ```yaml chains: - - name: osmosis-1 - type: osmosis + - id: osmosis-1 + name: osmosis numValidators: 1 scripts: createGenesis: @@ -284,8 +284,8 @@ that connect with the cometmock pod. Enabling cometmock is really simple with following ```yaml chains: -- name: cosmoshub-4 - type: cosmos +- id: cosmoshub-4 + name: cosmos numValidators: 4 cometmock: enabled: true diff --git a/docs/pages/config/index.mdx b/docs/pages/config/index.mdx index ba907f68..bdbd3106 100644 --- a/docs/pages/config/index.mdx +++ b/docs/pages/config/index.mdx @@ -12,14 +12,14 @@ Here is a basic example that will spin up: ```yaml chains: - - name: osmosis-1 - type: osmosis + - id: osmosis-1 + name: osmosis numValidators: 2 ports: rest: 1313 rpc: 26653 - - name: gaia-1 - type: cosmos + - id: gaia-1 + name: cosmos numValidators: 2 ports: rest: 1317 diff --git a/docs/pages/config/relayers.mdx b/docs/pages/config/relayers.mdx index b1d16e0e..68e7df9d 100644 --- a/docs/pages/config/relayers.mdx +++ b/docs/pages/config/relayers.mdx @@ -59,7 +59,7 @@ relayers: ## `chains` List of chains to connect to each other, via the Relayer. -Must be `name` of chains defined in the `chains` directive. +Must be `id` of chains defined in the `chains` directive. ```yaml chains: diff --git a/docs/pages/get-started/step-3.mdx b/docs/pages/get-started/step-3.mdx index 27018d35..14849fea 100644 --- a/docs/pages/get-started/step-3.mdx +++ b/docs/pages/get-started/step-3.mdx @@ -11,7 +11,7 @@ Run ```bash helm repo add starship https://cosmology-tech.github.io/starship/ helm repo update -helm search repo starship/devnet --version 0.1.45 +helm search repo starship/devnet --version 0.2.0 ``` ## 3.2) Define the desired infrastructure @@ -35,14 +35,14 @@ touch starship.yaml Add following content to `starship.yaml` with the following content ```yaml chains: - - name: osmosis-1 - type: osmosis + - id: osmosis-1 + name: osmosis numValidators: 1 ports: rest: 1313 rpc: 26653 - - name: gaia-1 - type: cosmos + - id: gaia-1 + name: cosmos numValidators: 1 ports: rest: 1317 @@ -76,7 +76,7 @@ For the tutorial we will keep it simple. ## 3.3) Spin up the infrastructure Spin up the infrastructure with ```bash -helm install -f starship.yaml tutorial starship/devnet --version 0.1.45 +helm install -f starship.yaml tutorial starship/devnet --version 0.2.0 # Where # -f starship.yaml: use the starship.yaml file as the configuration diff --git a/scripts/install.sh b/scripts/install.sh index 741ae1e7..80bef466 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -60,7 +60,7 @@ function set_helm_args() { return 0 fi for i in $(seq 0 $num_chains); do - chain=$(yq -r ".chains[$i].name" ${CONFIGFILE}) + chain=$(yq -r ".chains[$i].id" ${CONFIGFILE}) scripts=$(yq -r ".chains[$i].scripts" ${CONFIGFILE}) if [[ "$scripts" == "null" ]]; then return 0 diff --git a/scripts/port-forward.sh b/scripts/port-forward.sh index 078b11a5..8e1ef469 100755 --- a/scripts/port-forward.sh +++ b/scripts/port-forward.sh @@ -58,7 +58,7 @@ if [[ $num_chains -gt -1 ]]; then for i in $(seq 0 $num_chains); do # derive chain pod name from chain id # https://github.com/cosmology-tech/starship/blob/main/charts/devnet/templates/_helpers.tpl#L56 - chain=$(yq -r ".chains[$i].name" ${CONFIGFILE} ) + chain=$(yq -r ".chains[$i].id" ${CONFIGFILE} ) chain=${chain/_/"-"} localrpc=$(yq -r ".chains[$i].ports.rpc" ${CONFIGFILE} ) localgrpc=$(yq -r ".chains[$i].ports.grpc" ${CONFIGFILE} ) diff --git a/tests/e2e/config.go b/tests/e2e/config.go index 2ba29786..e5cc5f28 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -1,8 +1,8 @@ package e2e type Chain struct { + ID string `name:"id" json:"id" yaml:"id"` Name string `name:"name" json:"name" yaml:"name"` - Type string `name:"type" json:"type" yaml:"type"` NumValidators int `name:"num-validators" json:"num_validators" yaml:"numValidators"` Cometmock *Feature `name:"cometmock" json:"cometmock" yaml:"cometmock"` Faucet *Feature `name:"faucet" json:"faucet" yaml:"faucet"` @@ -46,7 +46,7 @@ type Config struct { // HasChainId returns true if chain id found in list of chains func (c *Config) HasChainId(chainId string) bool { for _, chain := range c.Chains { - if chain.Name == chainId { + if chain.ID == chainId { return true } } @@ -57,7 +57,7 @@ func (c *Config) HasChainId(chainId string) bool { // GetChain returns the Chain object pointer for the given chain id func (c *Config) GetChain(chainId string) *Chain { for _, chain := range c.Chains { - if chain.Name == chainId { + if chain.ID == chainId { return chain } } diff --git a/tests/e2e/configs/agoric.yaml b/tests/e2e/configs/agoric.yaml index 7d262fb7..0336406b 100644 --- a/tests/e2e/configs/agoric.yaml +++ b/tests/e2e/configs/agoric.yaml @@ -1,6 +1,6 @@ chains: - - name: agoric-3 - type: agoric + - id: agoric-3 + name: agoric image: ghcr.io/agoric/agoric-3-proposals:main numValidators: 1 faucet: @@ -13,8 +13,8 @@ chains: resources: cpu: 1 memory: 2Gi - - name: cosmoshub-4 - type: cosmos + - id: cosmoshub-4 + name: cosmos image: ghcr.io/cosmology-tech/starship/gaia:v10.0.1 numValidators: 1 ports: diff --git a/tests/e2e/configs/build-chain.yaml b/tests/e2e/configs/build-chain.yaml index a658a372..b80a965e 100644 --- a/tests/e2e/configs/build-chain.yaml +++ b/tests/e2e/configs/build-chain.yaml @@ -1,13 +1,13 @@ chains: - - name: cosmoshub-4 - type: cosmos + - id: cosmoshub-4 + name: cosmos numValidators: 2 ports: rest: 1317 rpc: 26657 exposer: 38087 - - name: core-1 - type: persistencecore + - id: core-1 + name: persistencecore numValidators: 2 build: enabled: true diff --git a/tests/e2e/configs/evmos.yaml b/tests/e2e/configs/evmos.yaml index df9afd6c..eac8be2c 100644 --- a/tests/e2e/configs/evmos.yaml +++ b/tests/e2e/configs/evmos.yaml @@ -1,14 +1,14 @@ chains: - - name: evmos_9000-1 - type: evmos + - id: evmos_9000-1 + name: evmos image: ghcr.io/cosmology-tech/starship/evmos:v13.0.2 numValidators: 2 ports: rest: 1313 rpc: 26653 exposer: 38083 - - name: cosmoshub-4 - type: cosmos + - id: cosmoshub-4 + name: cosmos image: ghcr.io/cosmology-tech/starship/gaia:v10.0.1 numValidators: 1 ports: diff --git a/tests/e2e/configs/injective.yaml b/tests/e2e/configs/injective.yaml index c62d483a..6d6d4e80 100644 --- a/tests/e2e/configs/injective.yaml +++ b/tests/e2e/configs/injective.yaml @@ -1,13 +1,13 @@ chains: - - name: injective-1 - type: injective + - id: injective-1 + name: injective numValidators: 2 ports: rest: 1313 rpc: 26653 exposer: 38083 - - name: cosmoshub-4 - type: cosmos + - id: cosmoshub-4 + name: cosmos numValidators: 1 ports: rest: 1317 diff --git a/tests/e2e/configs/multi-relayer.yaml b/tests/e2e/configs/multi-relayer.yaml index da11e0bc..3f67139c 100644 --- a/tests/e2e/configs/multi-relayer.yaml +++ b/tests/e2e/configs/multi-relayer.yaml @@ -1,6 +1,6 @@ chains: - - name: osmosis-1 - type: osmosis + - id: osmosis-1 + name: osmosis numValidators: 1 faucet: enabled: false @@ -8,8 +8,8 @@ chains: rest: 1313 rpc: 26653 exposer: 38083 - - name: cosmoshub-4 - type: cosmos + - id: cosmoshub-4 + name: cosmos image: ghcr.io/cosmology-tech/starship/gaia:v10.0.1 numValidators: 1 faucet: @@ -18,8 +18,8 @@ chains: rest: 1317 rpc: 26657 exposer: 38087 - - name: juno-2 - type: juno + - id: juno-2 + name: juno numValidators: 1 faucet: enabled: false diff --git a/tests/e2e/configs/multi-validator-starship-faucet.yaml b/tests/e2e/configs/multi-validator-starship-faucet.yaml index b7350f12..4e87107f 100644 --- a/tests/e2e/configs/multi-validator-starship-faucet.yaml +++ b/tests/e2e/configs/multi-validator-starship-faucet.yaml @@ -1,6 +1,6 @@ chains: - - name: osmosis-1 - type: osmosis + - id: osmosis-1 + name: osmosis numValidators: 2 ports: rest: 1313 diff --git a/tests/e2e/configs/multi-validator.yaml b/tests/e2e/configs/multi-validator.yaml index a5012419..5d25a1a5 100644 --- a/tests/e2e/configs/multi-validator.yaml +++ b/tests/e2e/configs/multi-validator.yaml @@ -1,6 +1,6 @@ chains: - - name: osmosis-1 - type: osmosis + - id: osmosis-1 + name: osmosis numValidators: 2 ports: rest: 1313 diff --git a/tests/e2e/configs/neutron.yaml b/tests/e2e/configs/neutron.yaml index 47169291..0eaf5cda 100644 --- a/tests/e2e/configs/neutron.yaml +++ b/tests/e2e/configs/neutron.yaml @@ -1,6 +1,6 @@ chains: - - name: neutron-1 - type: neutron + - id: neutron-1 + name: neutron numValidators: 1 faucet: enabled: false @@ -10,8 +10,8 @@ chains: rest: 1313 rpc: 26653 exposer: 38083 - - name: cosmoshub-4 - type: cosmos + - id: cosmoshub-4 + name: cosmos numValidators: 2 ports: rest: 1317 diff --git a/tests/e2e/configs/one-chain-cometmock.yaml b/tests/e2e/configs/one-chain-cometmock.yaml index 7d656a84..7b9ff216 100644 --- a/tests/e2e/configs/one-chain-cometmock.yaml +++ b/tests/e2e/configs/one-chain-cometmock.yaml @@ -1,6 +1,6 @@ chains: - - name: cosmoshub-4 - type: cosmos + - id: cosmoshub-4 + name: cosmos numValidators: 1 ports: rpc: 26653 diff --git a/tests/e2e/configs/one-chain-custom-scripts.yaml b/tests/e2e/configs/one-chain-custom-scripts.yaml index 66b46489..7523418f 100644 --- a/tests/e2e/configs/one-chain-custom-scripts.yaml +++ b/tests/e2e/configs/one-chain-custom-scripts.yaml @@ -1,6 +1,6 @@ chains: - - name: osmosis-1 - type: osmosis + - id: osmosis-1 + name: osmosis numValidators: 1 ports: rest: 1313 diff --git a/tests/e2e/configs/one-chain-starship-faucet.yaml b/tests/e2e/configs/one-chain-starship-faucet.yaml index 97337529..5b27d97d 100644 --- a/tests/e2e/configs/one-chain-starship-faucet.yaml +++ b/tests/e2e/configs/one-chain-starship-faucet.yaml @@ -1,6 +1,6 @@ chains: - - name: osmosis-1 - type: osmosis + - id: osmosis-1 + name: osmosis numValidators: 1 ports: rest: 1313 diff --git a/tests/e2e/configs/one-chain.yaml b/tests/e2e/configs/one-chain.yaml index 2966055d..9fe2b7c1 100644 --- a/tests/e2e/configs/one-chain.yaml +++ b/tests/e2e/configs/one-chain.yaml @@ -1,6 +1,6 @@ chains: - - name: osmosis-1 - type: osmosis + - id: osmosis-1 + name: osmosis numValidators: 1 metrics: true ports: diff --git a/tests/e2e/configs/one-custom-chain.yaml b/tests/e2e/configs/one-custom-chain.yaml index 33f5adc9..a1ee6027 100644 --- a/tests/e2e/configs/one-custom-chain.yaml +++ b/tests/e2e/configs/one-custom-chain.yaml @@ -1,6 +1,6 @@ chains: - - name: custom-1 - type: custom + - id: custom-1 + name: custom numValidators: 1 image: anmol1696/osmosis:latest home: /root/.osmosisd diff --git a/tests/e2e/configs/simapp.yaml b/tests/e2e/configs/simapp.yaml index 8d30fa6c..0b3b0333 100644 --- a/tests/e2e/configs/simapp.yaml +++ b/tests/e2e/configs/simapp.yaml @@ -4,8 +4,8 @@ images: imagePullPolicy: Always chains: - - name: simapp - type: simapp + - id: simapp + name: simapp image: ghcr.io/cosmos/simapp:latest numValidators: 2 ports: diff --git a/tests/e2e/configs/three-chain.yaml b/tests/e2e/configs/three-chain.yaml index 280cd5bb..b34b308b 100644 --- a/tests/e2e/configs/three-chain.yaml +++ b/tests/e2e/configs/three-chain.yaml @@ -1,6 +1,6 @@ chains: - - name: osmosis-1 - type: osmosis + - id: osmosis-1 + name: osmosis numValidators: 1 faucet: enabled: false @@ -8,8 +8,8 @@ chains: rest: 1313 rpc: 26653 exposer: 38083 - - name: cosmoshub-4 - type: cosmos + - id: cosmoshub-4 + name: cosmos image: ghcr.io/cosmology-tech/starship/gaia:v10.0.1 numValidators: 1 faucet: @@ -18,8 +18,8 @@ chains: rest: 1317 rpc: 26657 exposer: 38087 - - name: juno-2 - type: juno + - id: juno-2 + name: juno numValidators: 1 faucet: enabled: false diff --git a/tests/e2e/configs/two-chain-cometmock.yaml b/tests/e2e/configs/two-chain-cometmock.yaml index 36801073..eb054642 100644 --- a/tests/e2e/configs/two-chain-cometmock.yaml +++ b/tests/e2e/configs/two-chain-cometmock.yaml @@ -1,6 +1,6 @@ chains: - - name: osmosis-1 - type: osmosis + - id: osmosis-1 + name: osmosis numValidators: 2 faucet: enabled: false @@ -10,8 +10,8 @@ chains: ports: rpc: 26653 exposer: 38083 - - name: cosmoshub-4 - type: cosmos + - id: cosmoshub-4 + name: cosmos numValidators: 2 faucet: enabled: false diff --git a/tests/e2e/configs/two-chain-gorelayer.yaml b/tests/e2e/configs/two-chain-gorelayer.yaml index 60d8d034..08baa578 100644 --- a/tests/e2e/configs/two-chain-gorelayer.yaml +++ b/tests/e2e/configs/two-chain-gorelayer.yaml @@ -1,14 +1,14 @@ chains: - - name: osmosis-1 - type: osmosis + - id: osmosis-1 + name: osmosis numValidators: 2 ports: rest: 1313 rpc: 26653 exposer: 38083 faucet: 8001 - - name: cosmoshub-4 - type: cosmos + - id: cosmoshub-4 + name: cosmos numValidators: 2 ports: rest: 1317 diff --git a/tests/e2e/configs/two-chain-monitoring.yaml b/tests/e2e/configs/two-chain-monitoring.yaml index 51ecd5e7..6c1d1761 100644 --- a/tests/e2e/configs/two-chain-monitoring.yaml +++ b/tests/e2e/configs/two-chain-monitoring.yaml @@ -1,6 +1,6 @@ chains: - - name: osmosis-1 - type: osmosis + - id: osmosis-1 + name: osmosis numValidators: 2 metrics: true faucet: @@ -10,8 +10,8 @@ chains: rpc: 26653 exposer: 38083 faucet: 8001 - - name: cosmoshub-4 - type: cosmos + - id: cosmoshub-4 + name: cosmos image: ghcr.io/cosmology-tech/starship/gaia:v10.0.1 numValidators: 2 metrics: true diff --git a/tests/e2e/configs/two-chain.yaml b/tests/e2e/configs/two-chain.yaml index c764e262..37ef96d1 100644 --- a/tests/e2e/configs/two-chain.yaml +++ b/tests/e2e/configs/two-chain.yaml @@ -1,15 +1,14 @@ chains: - - name: osmosis-1 - type: osmosis + - id: osmosis-1 + name: osmosis numValidators: 2 ports: rest: 1313 rpc: 26653 exposer: 38083 faucet: 8001 - - name: cosmoshub-4 - type: cosmos - image: ghcr.io/cosmology-tech/starship/gaia:v10.0.1 + - id: cosmoshub-4 + name: cosmos numValidators: 2 faucet: enabled: false diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index 67068a3e..7dd74578 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -63,7 +63,7 @@ func (s *TestSuite) TestChains_Status() { s.T().Log("running test for /status endpoint for each chain") for _, chain := range s.config.Chains { - if chain.Type == "neutron" { + if chain.Name == "neutron" { s.T().Skip("skip tests for neutron") } url := fmt.Sprintf("http://0.0.0.0:%d/status", chain.Ports.Rpc) @@ -76,7 +76,7 @@ func (s *TestSuite) TestChains_Status() { s.Require().NoError(err) // assert chain id - s.Require().Equal(chain.Name, resp.Result.NodeInfo.Network) + s.Require().Equal(chain.ID, resp.Result.NodeInfo.Network) } } @@ -85,7 +85,7 @@ func (s *TestSuite) TestChains_StakingParams() { s.T().Skip("skip staking params test for non rest endpoint") } s.T().Log("running test for /staking/parameters endpoint for each chain") - if s.config.Chains[0].Type == "neutron" { + if s.config.Chains[0].Name == "neutron" { s.T().Skip("skip tests for neutron") } diff --git a/tests/e2e/exposer_test.go b/tests/e2e/exposer_test.go index ec2c4419..ddd2ef69 100644 --- a/tests/e2e/exposer_test.go +++ b/tests/e2e/exposer_test.go @@ -55,7 +55,7 @@ func (s *TestSuite) TestExposer_GetGenesisFile() { // assert results to expected values s.Require().NotNil(resp) - s.Require().Equal(chain.Name, resp.AsMap()["chain_id"]) + s.Require().Equal(chain.ID, resp.AsMap()["chain_id"]) } func (s *TestSuite) TestExposer_GetPubKey() { diff --git a/tests/e2e/faucet_test.go b/tests/e2e/faucet_test.go index 145e04c5..50d0fcc3 100644 --- a/tests/e2e/faucet_test.go +++ b/tests/e2e/faucet_test.go @@ -29,7 +29,7 @@ func (s *TestSuite) TestFaucet_Status() { s.T().Log("running test for /status endpoint for faucet") for _, chain := range s.config.Chains { - s.Run(fmt.Sprintf("facuet test for: %s", chain.Name), func() { + s.Run(fmt.Sprintf("facuet test for: %s", chain.ID), func() { if chain.Ports.Faucet == 0 { s.T().Skip("faucet not exposed via ports") } @@ -77,12 +77,12 @@ func (s *TestSuite) getChainAccounts(chain *Chain) []string { } func (s *TestSuite) getChainDenoms(chain *Chain) string { - req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/chains/%s", chain.Name), nil) + req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/chains/%s", chain.ID), nil) s.Require().NoError(err) respChain := &pb.ChainRegistry{} s.MakeRegistryRequest(req, respChain) - s.Require().Equal(chain.Name, respChain.ChainId) + s.Require().Equal(chain.ID, respChain.ChainId) s.Require().NotEmpty(respChain.Fees.FeeTokens[0].Denom) @@ -122,14 +122,14 @@ func (s *TestSuite) TestFaucet_Credit() { expCreditedAmt := float64(10000000000) for _, chain := range s.config.Chains { - s.Run(fmt.Sprintf("facuet test for: %s", chain.Name), func() { + s.Run(fmt.Sprintf("facuet test for: %s", chain.ID), func() { if chain.Ports.Faucet == 0 { s.T().Skip("faucet not exposed via ports") } // fetch denom and address from an account on chain denom := s.getChainDenoms(chain) - addr := getAddressFromType(chain.Type) + addr := getAddressFromType(chain.Name) beforeBalance := s.getAccountBalance(chain, addr, denom) body := map[string]string{ diff --git a/tests/e2e/registry_test.go b/tests/e2e/registry_test.go index 53ebe782..949c36f3 100644 --- a/tests/e2e/registry_test.go +++ b/tests/e2e/registry_test.go @@ -61,10 +61,10 @@ func (s *TestSuite) TestRegistry_ListChains() { expChain := s.config.GetChain(chain.ChainId) s.Require().NotNil(expChain) - if expChain.Type == "custom" { - s.Require().Equal(expChain.Name, chain.ChainName) + if expChain.Name == "custom" { + s.Require().Equal(expChain.ID, chain.ChainName) } else { - s.Require().Equal(expChain.Type, chain.ChainName) + s.Require().Equal(expChain.Name, chain.ChainName) } } } @@ -76,17 +76,17 @@ func (s *TestSuite) TestRegistry_GetChain() { s.T().Log("running test for /chains/{chain} endpoint for registry") for _, chain := range s.config.Chains { - req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/chains/%s", chain.Name), nil) + req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/chains/%s", chain.ID), nil) s.Require().NoError(err) respChain := &pb.ChainRegistry{} s.MakeRegistryRequest(req, respChain) - s.Require().Equal(chain.Name, respChain.ChainId) - if chain.Type == "custom" { - s.Require().Equal(chain.Name, respChain.ChainName) + s.Require().Equal(chain.ID, respChain.ChainId) + if chain.Name == "custom" { + s.Require().Equal(chain.ID, respChain.ChainName) } else { - s.Require().Equal(chain.Type, respChain.ChainName) + s.Require().Equal(chain.Name, respChain.ChainName) } if chain.Ports.Rpc != 0 { s.Require().Equal(fmt.Sprintf("http://localhost:%d", chain.Ports.Rpc), respChain.Apis.Rpc[0].Address) @@ -99,7 +99,7 @@ func (s *TestSuite) TestRegistry_GetChain() { } // chain specific assetertions - if chain.Type == "osmosis" { + if chain.Name == "osmosis" { s.Require().Equal("osmosis", respChain.PrettyName) } } @@ -112,7 +112,7 @@ func (s *TestSuite) TestRegistry_ListChainPeers() { s.T().Log("running test for /chains/{chain}/peers endpoint for registry") for _, chain := range s.config.Chains { - req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/chains/%s/peers", chain.Name), nil) + req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/chains/%s/peers", chain.ID), nil) s.Require().NoError(err) respPeers := &pb.Peers{} @@ -130,7 +130,7 @@ func (s *TestSuite) TestRegistry_ListChainApis() { s.T().Log("running test for /chains/{chain}/apis endpoint for registry") for _, chain := range s.config.Chains { - req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/chains/%s/apis", chain.Name), nil) + req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/chains/%s/apis", chain.ID), nil) s.Require().NoError(err) respAPIs := &pb.APIs{} @@ -164,15 +164,15 @@ func (s *TestSuite) TestRegistry_GetChainAssets() { } for _, chain := range s.config.Chains { - req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/chains/%s/assets", chain.Name), nil) + req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/chains/%s/assets", chain.ID), nil) s.Require().NoError(err) respAssets := &pb.ResponseChainAssets{} s.MakeRegistryRequest(req, respAssets) - chainName := chain.Type - if chain.Type == "custom" { - chainName = chain.Name + chainName := chain.Name + if chain.Name == "custom" { + chainName = chain.ID } s.Require().Equal(chainName, respAssets.ChainName) @@ -258,9 +258,9 @@ func (s *TestSuite) TestRegistry_GetChainAssets_Osmosis() { ] }` - req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/chains/%s/assets", chain.Name), nil) + req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/chains/%s/assets", chain.ID), nil) s.Require().NoError(err) - host := fmt.Sprintf("http://0.0.0.0:%d/chains/%s/assets", s.config.Registry.Ports.Rest, chain.Name) + host := fmt.Sprintf("http://0.0.0.0:%d/chains/%s/assets", s.config.Registry.Ports.Rest, chain.ID) url, err := urlpkg.Parse(host) s.Require().NoError(err) req.URL = url @@ -299,7 +299,7 @@ func (s *TestSuite) TestRegistry_GetChainKeys() { s.T().Log("running test for /chains/{chain}/keys endpoint for registry") for _, chain := range s.config.Chains { - req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/chains/%s/keys", chain.Name), nil) + req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/chains/%s/keys", chain.ID), nil) s.Require().NoError(err) respKeys := &pb.Keys{}