-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into anmol/faucet-less
- Loading branch information
Showing
15 changed files
with
185 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{{/* | ||
Given a chain name, create a fullchain dict and return | ||
Usage: | ||
{{ include "devnet.getchain" (dict "name" cosmoshub-4 "file" $.File "context" $) }} | ||
*/}} | ||
{{- define "devnet.getchain" -}} | ||
{{- $defaultFile := $.file -}} | ||
{{- required "default file must have setup" $defaultFile.defaultChains -}} | ||
{{- $chain := dict -}} | ||
{{- range $chainIter := $.context.Values.chains -}} | ||
{{- if eq $chainIter.name $.name -}} | ||
{{- $chain = $chainIter | deepCopy -}} | ||
{{- end }} | ||
{{- end }} | ||
{{- required "chain need to exist" $chain.type -}} | ||
|
||
{{- $defaultChain := get $defaultFile.defaultChains $chain.type | default dict -}} | ||
|
||
{{/* merge defaultChain values into the $chain dict*/}} | ||
{{- $chain = merge $chain $defaultChain -}} | ||
|
||
{{ $_ := set $chain "hostname" (include "devnet.chain.name" $chain.name) }} | ||
|
||
{{- $faucet := get $chain "faucet" | default dict -}} | ||
{{- $faucet = mergeOverwrite ($.context.Values.faucet | deepCopy) $faucet -}} | ||
{{- $defaultFaucet := get $defaultFile.defaultFaucet $faucet.type | default dict -}} | ||
{{- $faucet = merge $faucet $defaultFaucet -}} | ||
{{ $_ = set $chain "faucet" $faucet -}} | ||
|
||
{{- if not (hasKey $chain "upgrade")}} | ||
{{ $_ = set $chain "upgrade" (dict "enabled" false) }} | ||
{{- end }} | ||
|
||
{{- if not (hasKey $chain "build")}} | ||
{{ $_ = set $chain "build" (dict "enabled" false) }} | ||
{{- end }} | ||
|
||
{{- $toBuild := or $chain.build.enabled $chain.upgrade.enabled -}} | ||
{{- $_ = set $chain "toBuild" $toBuild -}} | ||
{{- if $toBuild -}} | ||
{{- $_ = set $chain "image" "ghcr.io/cosmology-tech/starship/runner:latest" -}} | ||
{{- end }} | ||
|
||
{{- $defaultScripts := $defaultFile.defaultScripts }} | ||
{{- $scripts := get $chain "scripts" | default dict }} | ||
{{- $scripts = merge $scripts $defaultScripts }} | ||
{{- $_ = set $chain "scripts" $scripts }} | ||
|
||
{{ println "@return" }} | ||
{{ mustToJson $chain }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Given a chain name, create a fullchain dict and return. Wraper | ||
Usage: | ||
{{ include "devnet.fullchain" (dict "name" cosmoshub-4 "file" $defaultFile "context" $) | fromtJson }} | ||
*/}} | ||
{{- define "devnet.fullchain"}} | ||
{{ index (splitList "@return\n" (include "devnet.getchain" .)) 1 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.