Skip to content

Commit

Permalink
feat: custom env vars for chain (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpatrickdev committed May 29, 2024
1 parent 0e18757 commit f6928ad
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 1 deletion.
14 changes: 14 additions & 0 deletions docs/pages/config/chains.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,20 @@ Noteable other versions are: `v0.34.x` as well as `v0.38.x`.
If `cometmock` is enabled, during port-forwarding, we forward the `ports.rpc` to the cometmock endpoint.
For in-cluster communication, make sure to connect to the cometmock service instead of validator service for rpc connections.

## `env` (optional)
The `env` directive allows you to set custom environment variables for the validator and genesis containers. This can be useful for enabling features like debug logging or configuring specific settings.

The `env` directive expects an array of objects, each containing a `name` and `value` field. Here's an example of how to use the `env` directive:
```yaml
chains:
- id: agoriclocal
name: agoric
numValidators: 1
env:
- name: DEBUG
value: SwingSet:vat,SwingSet:ls
```

### Learn more
To more about CometMock, have a look at the [blog](https://informal.systems/blog/cometmock) that explains its working

Expand Down
4 changes: 4 additions & 0 deletions starship/charts/devnet/templates/chains/cosmos/genesis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ spec:
value: "{{ $chain.faucet.enabled }}"
- name: SLOGFILE
value: "slog.slog"
{{- range $env := $chain.env }}
- name: {{ $env.name }}
value: {{ $env.value | quote }}
{{- end }}
command:
- bash
- "-c"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ spec:
value: /configs/keys.json
- name: SLOGFILE
value: "slog.slog"
{{- range $env := $chain.env }}
- name: {{ $env.name }}
value: {{ $env.value | quote }}
{{- end }}
command:
- bash
- "-c"
Expand Down Expand Up @@ -291,4 +295,4 @@ spec:
---
{{- end }}
{{- end }}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions starship/charts/devnet/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,21 @@
},
"additionalProperties": false
},
"env": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": ["name", "value"]
}
},
"resources": { "$ref": "#/$def/resources" },
"cometmock": {
"type": "object",
Expand Down
4 changes: 4 additions & 0 deletions starship/charts/devnet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ chains: []
# buildChain:
# file: local/scripts/build-chain.sh
# data: |- # data is a multiline string injected from --set-file in helm
# # set custom environment variables for the `validator` container
# env:
# - name: DEBUG
# value: true

# TODO: ability to check the srcConnection and destConnection to use
relayers: []
Expand Down

0 comments on commit f6928ad

Please sign in to comment.